Profile Picture

Is there a way to use the legend item to obtain the series where it belongs?

Posted By Paulo Silva 10 Years Ago

Is there a way to use the legend item to obtain the series where it...

Author
Message
Paulo Silva
Posted 10 Years Ago
View Quick Profile
Junior Member

Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 13, Visits: 12
I want to be able to identify a series from a legend item.

private void nChartControl1_MouseClick(object sender, MouseEventArgs e)
{
NHitTestResult hitTestResult = nChartControl1.HitTest(e.X, e.Y);

if (hitTestResult.ChartElement == ChartElement.LegendDataItem)
{
NLegendItemCellData legendItemCellData = hitTestResult.LegendDataItem;

int legendItemIndex = hitTestResult.LegendDataItemIndex;
int index = hitTestResult.ObjectIndex;

foreach (NSeries ser in chart.Series)
{
// find the series
}
MessageBox.Show("this legendItem belongs to the serie ...");
}
}






Similar Topics


Reading This Topic