4 Answers, 1 is accepted
0
Hello Paulo,
Regards,
Evgenia
the Telerik team
You can handle the BeforeLayout or PrePaint events of RadChart and customize the Marker.Appearance.Figure property of the legend items to any of the predefined figures:
- Cross
- Diamond
- Ellipse
- Circle
- Rectangle
- Star3
- Star4
- Star5
- Star6
Regards,
Evgenia
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.
0
Paulo
Top achievements
Rank 1
answered on 17 May 2012, 01:12 PM
I have dificult to put this code.
radChart1.Legend.Marker.Appearence.Figure = Rectangle; // Do no work ==>> Error radChart1.Legend.Marker.Appearence.Figure = radChart1.Legend.Marker.Appearence.Figure = "Rectangle"; // Do not work
I get a example in this forum and nothing too.
void radChart1_BeforeLayout(object sender,EventAtgs e)
{
radChart1.Legend.Items.Clear();
LabelItem li = new LabelItem();
li.Marker.Appearence.Figure = DefaultFigures.Rectangle;//Error in DefaultFigures
.....................................
}
My questions is: How Can I do?
radChart1.Legend.Marker.Appearence.Figure = Rectangle; // Do no work ==>> Error radChart1.Legend.Marker.Appearence.Figure = radChart1.Legend.Marker.Appearence.Figure = "Rectangle"; // Do not work
I get a example in this forum and nothing too.
void radChart1_BeforeLayout(object sender,EventAtgs e)
{
radChart1.Legend.Items.Clear();
LabelItem li = new LabelItem();
li.Marker.Appearence.Figure = DefaultFigures.Rectangle;//Error in DefaultFigures
.....................................
}
My questions is: How Can I do?
0
Hi Paulo,
If you have one series only or you want each of the series in your chart to be with same Legend Figures you may simply use this code line:
RadChart1.Legend.Appearance.ItemMarkerAppearance.Figure = Telerik.Charting.Styles.DefaultFigures.Rectangle;
Otherwise you'll have to wire to PrePaint or BeforeLayout events of the chart and loop through legend items as shown below to change the Legend Figures:
protected void RadChart1_BeforeLayout(object sender, EventArgs e)
{
foreach (LabelItem item in RadChart1.Legend.Items)
{
item.Marker.Appearance.Figure
= Telerik.Charting.Styles.DefaultFigures.Rectangle;
}
}
Kind regards,
Evgenia
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.
0
Paulo
Top achievements
Rank 1
answered on 18 May 2012, 01:43 PM
Ok, worked. Thanks for all.