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

binding problem

2 Answers 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
pavel
Top achievements
Rank 1
pavel asked on 27 Apr 2012, 04:39 PM
Advice please.
I created a chart and pribindil. Y-axis indicated the binding property of the COUNTand have DATALABELSCOLUMN NAME. And the legend is not a list of the collection. 

http://i50.tinypic.com/2cxi635.png 

chart1.DataSource = linqToSQL.TableItems.GroupBy(g => g.ColumnInt)
.Select(s =>
new Item { count = s.Count(), name = s.First().Name })
.OrderByDescending(o => o.count).Take(10);

class Item 
{
    public int count { get; set; }
    public string name { get; set; }
}
That is, shows the schedule is correct, but the description of the legend is not correct. 
With respect, thanks 

tableitem

2 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 02 May 2012, 11:46 AM
Hello Sergei,

If understood correctly, you want the chart's legend to show the item names (one item in the legend for each item in the chart). If that is the case then you need to use Appearance.LegendDisplayMode property. In order to use this property, you need to explicitly create the Series. After the series are created you can simply set it like this:

chart.Series[0].Appearance.LegendDisplayMode = Telerik.Reporting.Charting.ChartSeriesLegendDisplayMode.ItemLabels;
All the best,
Elian
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
pavel
Top achievements
Rank 1
answered on 02 May 2012, 04:31 PM
Thank you very much, it came out.
However that's only if you edit a property in the designer LegendDisplayMode is why it is not used and returned to the SeriesName. 
Tags
General Discussions
Asked by
pavel
Top achievements
Rank 1
Answers by
Elian
Telerik team
pavel
Top achievements
Rank 1
Share this question
or