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

Chart events never called = chart1.DataBound += (object sender3, ChartDataBoundEventArgs e3) =>

1 Answer 21 Views
Chart
This is a migrated thread and some comments may be shown as answers.
alpascual
Top achievements
Rank 2
alpascual asked on 03 May 2010, 09:16 PM

Trying to override the Legend Items that are created automatically, just need to change the labels from Item 0, Item 1 … to my own labels, I don’t want to do it manually, if I do so I lose the colors that automatically you guys assigned. Now I have tried to subscribe to events like

chart1.DataBound += (object sender3, ChartDataBoundEventArgs e3) =>

without any luck as I just want to access the collection of Items Labels after then have been created to change it from Item 0 to my own writing. What’s the event that I can subscribe that will work?

1 Answer, 1 is accepted

Sort by
0
alpascual
Top achievements
Rank 2
answered on 03 May 2010, 10:29 PM
Found the solution and the event that will be called, however this works like the ASP.NET Binding, I should be able to access to the Legend Item Collection after was bound instead of having to get call at every item at binding time and override the name, the performance isn't that good.

chart1.ItemDataBound += (

 

object sender3, ChartItemDataBoundEventArgs e3) =>

 

{

e3.DataPoint.LegendLabel = GetMyName(e3.DataPoint);

 

};

Tags
Chart
Asked by
alpascual
Top achievements
Rank 2
Answers by
alpascual
Top achievements
Rank 2
Share this question
or