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

Other figures to the Legend

2 Answers 23 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 25 Jun 2012, 07:56 PM

 

I have a graph with 8 series. Four bars and four line series. I need to add a new figure to the legends of line graphics and only them. How do I add new pictures?

The bars series, I use a rectangle, but the Line series other figure. Figures that do not belong to the list.

Is posible to add new Figures to a Legend? Is posible?
Thanks for all.

2 Answers, 1 is accepted

Sort by
0
Paulo
Top achievements
Rank 1
answered on 25 Jun 2012, 08:09 PM
I did so and did not work:

radChart1.Legend.AddCustomItemToLegend("Serie5", new Telerik.Charting.Styles.FillStyle(),"~/App_Themes/Default/Imagens/lupa.png");

Image does not load.
0
Peshito
Telerik team
answered on 28 Jun 2012, 09:00 AM
Hello,

Try attaching to chart's BeforeLayout event and then set the picture you'd like to use as a custom figure like this:
radChart.BeforeLayout += new EventHandler<EventArgs>(radChart_BeforeLayout);
void radChart_BeforeLayout(object sender, EventArgs e)
    {
        radChart.Legend.Items[0].Marker.Appearance.Figure = "Rectangle";
        radChart.Legend.Items[1].Marker.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Image;
        radChart.Legend.Items[1].Marker.Appearance.FillStyle.FillSettings.BackgroundImage = "C:\\Pictures\\ChartImage.png";
    }
Using this approach should set a custom image as a legend item marker.

Hope this helps.

Kind regards,
Peshito
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
Paulo
Top achievements
Rank 1
Answers by
Paulo
Top achievements
Rank 1
Peshito
Telerik team
Share this question
or