c# - AjaxControlToolkit PieChart graphic does not render if only one data value is added -
i enter data dynamically code behind:
piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "1", data = count1 });
it supposed reflect number of ratings 1-10 use of switch (i didn't show entire switch because cumbersome). in case, if 1 person gives rating of 1, count1 = 1, , want pie chart reflect that, instead control remains blank , has 1 way @ corner, legend still there.
is bug or missing something?
update: here switch goes through ratings 1 - 10 , adds amount of particular rating chart:
for (int = 1; <= 10; i++) { switch (i) { case 1: if (count1 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "1", data = count1 }); } break; case 2: if (count2 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "2", data = count2 }); } break; case 3: if (count3 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "3", data = count3 }); } break; case 4: if (count4 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "4", data = count4 }); } break; case 5: if (count5 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "5", data = count5 }); } break; case 6: if (count6 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "6", data = count6 }); } break; case 7: if (count7 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "7", data = count7 }); } break; case 8: if (count8 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "8", data = count8 }); } break; case 9: if (count9 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "9", data = count9 }); } break; case 10: if (count10 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "10", data = count10 }); } break; }
you doing right, piechart not produce valid svg markup when there single value in series, see nothing in result.
Comments
Post a Comment