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

[Solved] How to achieve BarSeries's RadLegendControl

3 Answers 95 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wang
Top achievements
Rank 1
Wang asked on 13 Dec 2012, 07:17 AM
I konw PieSeries have a LegendTitleBinding property ,LegendTitleBinding property can auto generate LegendItems,Now,I want to let BarSeries can auto generate LegendItems when I set SeriesPaletteMode equals  SeriesPaletteMode.DataPoint,but barSeries has no LegendTitleBinding property,It only has a LegendTitle Property ,how can i do ?

3 Answers, 1 is accepted

Sort by
0
Wang
Top achievements
Rank 1
answered on 14 Dec 2012, 07:33 AM
Can anybody help me?
0
Accepted
Ivaylo Gergov
Telerik team
answered on 14 Dec 2012, 01:07 PM
Hi Wang,

Thank you for using our RadControls for Windows 8!

At this point RadLegendControl generates LegendItems per Series basis - only for PieChart it is per DataPoint basis. This is already logged as a feature request and it will be implemented in one of our next releases. Additionally I can suggest you as a workaround to add LegendItems manually for each Bar DataPoint. Here's an example:
<telerikPrimitives:RadLegendControl x:Name="LegendControl"/>

this.LegendControl.LegendItems.Add(new LegendItem() { Title = "point1", Fill = this.chart.Palette.GetBrush(0,PaletteVisualPart.Fill), Stroke = this.chart.Palette.GetBrush(0,PaletteVisualPart.Stroke) });
this.LegendControl.LegendItems.Add(new LegendItem() { Title = "point2", Fill = this.chart.Palette.GetBrush(1, PaletteVisualPart.Fill), Stroke = this.chart.Palette.GetBrush(1, PaletteVisualPart.Stroke) });
this.LegendControl.LegendItems.Add(new LegendItem() { Title = "point3", Fill = this.chart.Palette.GetBrush(2, PaletteVisualPart.Fill), Stroke = this.chart.Palette.GetBrush(2, PaletteVisualPart.Stroke) });

I hope this helps. Let me know if I can assist you any further.

 
All the best,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Wang
Top achievements
Rank 1
answered on 17 Dec 2012, 07:09 AM
Thanks
Tags
Chart for XAML
Asked by
Wang
Top achievements
Rank 1
Answers by
Wang
Top achievements
Rank 1
Ivaylo Gergov
Telerik team
Share this question
or