This is a migrated thread and some comments may be shown as answers.

Pie Chart Legend Problem

1 Answer 96 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 13 Aug 2008, 04:12 PM
Hello,
 
  I have a pie chart bound to a sql data source:

select CarMake, count(*) as CarTotal from Cars group by CarMake

  I'm having trouble getting the legend to show each CarMake with its pie piece color. All I get is CarTotal in the legend. How can I change the legend (either in the wizard or the vb code) to show each CarMake? I've tried several different settings in the wizard and haven't found the right solution yet.

  Also, how do I get the percentage of total each count is to display on the pie chart? Sorry if this is obvious. I've searched on the forums for a while and haven't been able to find anything that makes mine work.

Thanks,
Ben

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 14 Aug 2008, 10:53 AM
Hi Ben,

You can set the ChartSeries.Appearance.LegendDisplayMode to "ItemLabels" in order to show a legend item for each chart series item:

<telerik:RadChart ID="RadChart1" runat='server' >
    <Series>
        <telerik:ChartSeries Type="pie">
            <Appearance LegendDisplayMode="ItemLabels" />

Onto your question about the percentage - you can use DefaultLabelValue property. Please, find more details in the following help topic and blog post.
                      
Hope this helps.

All the best,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
Ben
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or