vaughndumas@gmail.com Posted March 14, 2013 Report Share Posted March 14, 2013 Hi,I have a problem getting the Pie charts to work. Instead of having all the data in a single chart, I'm getting 3 different charts. Here's my code: var chart1; function loadChart() { chart1 = new cfx.Chart(); var data = [{ "a": 5, "b": 6, "c": 4 }]; chart1.setDataSource(data); chart1.setGallery(cfx.Gallery.Pie); chart1.create('ChartDiv');} If you have any ideas as to how to fix this or can point me in the right direction I'd appreciate it.Take care,Vaughn Quote Link to comment Share on other sites More sharing options...
0 angelr Posted March 14, 2013 Report Share Posted March 14, 2013 You have to change the data object notation.Try this: var chart1;function loadChart() { chart1 = new cfx.Chart(); var data = [{ "Label": "a", "Value": 5 }, { "Label": "b", "Value": 6 }, { "Label": "c", "Value": 4 }]; chart1.setDataSource(data); chart1.setGallery(cfx.Gallery.Pie); chart1.create('ChartDiv'); } Quote Link to comment Share on other sites More sharing options...
0 vaughndumas@gmail.com Posted March 14, 2013 Author Report Share Posted March 14, 2013 You rock! Thank you very much for the help; it's most appreciated. Take care, Vaughn Quote Link to comment Share on other sites More sharing options...
0 sudharsan Posted April 8, 2013 Report Share Posted April 8, 2013 Please send the pie chart download file fully . i have error cfx is 'not defined' please help me my email is soosmca@gmail.com Quote Link to comment Share on other sites More sharing options...
Question
vaughndumas@gmail.com
Hi,
I have a problem getting the Pie charts to work. Instead of having all the data in a single chart, I'm getting 3 different charts. Here's my code:
var chart1;
function loadChart() {
chart1 = new cfx.Chart();
var data = [{
"a": 5,
"b": 6,
"c": 4
}];
chart1.setDataSource(data);
chart1.setGallery(cfx.Gallery.Pie);
chart1.create('ChartDiv');
}
If you have any ideas as to how to fix this or can point me in the right direction I'd appreciate it.
Take care,
Vaughn
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.