use chartjs_image::ChartJSImage;
fn main() {
let account_id = "YOUR_ACCOUNT_ID";
let secret_key = "YOUR_SECRET_KEY";
let url = ChartJSImage::builder()
.secret(secret_key)
.build()
.chart(r#"{
"type": "pie",
"data": {
"labels": ["Hello", "World"],
"datasets": [{
"data": [60, 40]
}]
}
}"#)
.width("700")
.height("300")
.icac(account_id)
.to_url();
println!("Signed Chart URL: {}", url);
assert!(url.contains("ichm="), "URL should contain HMAC signature");
println!("✓ URL is signed with HMAC-SHA256");
}