문제

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