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

Unable to modify legend marker

1 Answer 110 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Jafin
Top achievements
Rank 2
Jafin asked on 06 Nov 2008, 12:31 AM
RadChart 2008 Q2.

I build a radchart programatticaly and first setup the styles:

chart.Skin = "";
chart.Legend.Marker.Appearance.Border.Visible = false;
chart.Legend.Marker.Appearance.Border.Color = Color.Black;
chart.Legend.Marker.Appearance.Figure = "Rectangle";
chart.AddChartSeries(series)

On Render, none of the legend modifications hold, ie the markers are round, the border is light blue.   Is there something I need to set to get this to override the defaults?


Thanks,
Jason

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 07 Nov 2008, 09:17 AM
Hi Jafin,

You can customize the legend marker figure like this:

protected void Page_Load(object sender, EventArgs e) 
    RadChart1.Legend.Appearance.ItemMarkerAppearance.Figure = Telerik.Charting.Styles.DefaultFigures.Rectangle; 

However, it is not possible to globally customize the appearance for all legend markers -- still, you can handle the BeforeLayout server-side event and customize the individual markers like this:

protected void RadChart1_BeforeLayout(object sender, EventArgs e) 
    RadChart1.Legend.Items[0].Marker.Appearance.Border.Color = Color.Black; 


Greetings,
Manuel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
Jafin
Top achievements
Rank 2
Answers by
Giuseppe
Telerik team
Share this question
or