jjlink
-
Posts
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by jjlink
-
-
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.
-
Juan, I can tweak the data i.e.
var first = items[0];
first["Value"] = aNumberVariable;
but when I do the whole pie does not show up,just a sliver.
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": 3711095
}, {
"Country": "Usable",
"Value": 100
}];
var second = items[1];
second["Value"] = varOverhead;
chart1.setDataSource(items);
}thanks so much for the help, this is really cool.
-
can I pass a variable into the array. I am running php against a db to get the values. wondering if I can pass that into a value in the array?
function doData() {
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": 3711095
}, {
"Country": "Usable",
"Value": 10000
}];
chart1.setDataSource(items);
} -
-
getting the following error:
TypeError: cfx.annotation is undefined
code:
<!-- add from scratch -->
-
TypeError:cfx.annotation is undefined
the error line is:
var ann = new cfx.annotation.Annotations();
any ideas?????
drilldown demo
in General Questions
Posted
I got it. I was passing the variable as a string and not a integer. As you can see I am very shaky with javascript. I have the pie working and will now concentrate on the drilldown. Thanks much for your patience and help.