سؤال

I am using Dojo 1.6 to generate pie chart.

while i am using legend in pie chart, the slice percentage (%) is disappeared. and if i remove the legend code from the chart code slice % is appears. But i needs to show both. How can both of these (% and legend) will appear in the same pie chart.

the chart without percentage,look like as...

enter image description here

code to create Legend...

       new dojox.charting.widget.Legend({ 
                 chart : chart,
                 horizontal : true
                 }, "legend2");

لا يوجد حل صحيح

نصائح أخرى

Ok, is not about the legend widget, the problems is with the data you used.

In order to display the percent values, you need to define the legend text like this:

var chartData = [
    {x:1,y:5,legend:"Income"},
    {x:1,y:10,legend:"Outcome"},
];

With this data, the percent values will be calculated and displayed on the chart, and the legend widget will display the proper labels

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top