Juan, the issue appears to be the following:
when you hard code the values it adds them up to create the whole pie, then divides each piece.
when you use a variable it concatenates the values to come up with the size of the pie.
function doData() {
var varUsable = "<?php echo $Usable; ?>";
var varOverhead = "<?php echo $Overhead; ?>";
chart1.getDataSourceSettings().getFields().clear();
var items = [{
/*"Country": "Costa Rica",
"Value": 3711095
}, {
"Country": "El Salvador",
"Value": 6125782
}, {
"Country": "Guatemala",
"Value": 11085025
}, {
"Country": "Honduras",
"Value": 6347658
}, {
"Country": "Nicaragua",
"Value": 4935148*/
"Country": "Array Overhead",
"Value": 30
}, {
"Country": "Usable",
"Value": varUsable
}];
/*var second = items[1];
second["Value"] = varOverhead;*/
chart1.setDataSource(items);
}
the value of varUsable is 58. the pie them becomes 3058. if I hard code the value to be 58, the pie becomes 88.