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

Advanced Chart Functionality

1 Answer 59 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Top achievements
Rank 1
Jay asked on 16 Apr 2012, 09:23 PM
I was wondering if i can expand the series legend box and have more information in it like the attached picture. I would like to have legend look like what it has for "top 5 spending" is it possible?

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 19 Apr 2012, 09:24 AM
Hello Jay,

Expanding the legend like the scenario you have described is not supported out of the box.

In order to display custom count of legend items, you can either set them manually by wiring to the BeforeLayout event like this:
void radChart_BeforeLayout(object sender, EventArgs e)
        radChart.Legend.Visible = true;
        LabelItem label1 = new LabelItem();
        label1.TextBlock.Text = "Label 1";
        label1.Visible = true;
        LabelItem label2 = new LabelItem();
        label2.TextBlock.Text = "Label 2";
        label2.Visible = true;
        LabelItem label3 = new LabelItem();
        label3.TextBlock.Text = "Label 3";
        label3.Visible = true;
or you can wire the ItemDataBound event of RadChart. In the event handler you can set the Name property of each individual ChartSeriesItem -- this is the value which will appear in the legend. The event arguments will hold references to the ChartSeriesItem, ChartSeries and the underlying data. It would be similar to what's shown in this blog post, but you need to set the Name property and not the Label's text.

Hope this helps.

the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Chart (obsolete as of Q1 2013)
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question