Hi David,
I noticed some Nevron bar chart examples using fruit & veg, I guess that was why I had fruit and veg on the brain
Yes this also crossed my mind
You can add tags to the data points/series in the same way you can add individual fill styles, stroke etc. Following is the revised code that shows how to tag data points:
class NFruitTag
{
public NFruitTag(string tag)
{
m_Tag = tag;
}
public string m_Tag;
}
private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
chart.BoundsMode = BoundsMode.Stretch;
// add some sample data
NBarSeries apples = new NBarSeries();
NBarSeries oranges = new NBarSeries();
Random rand = new Random();
for (int i = 0; i < 10; i++)
{
apples.Values.Add(rand.Next(100));
apples.Tags.Add(i, new NFruitTag("Apple " + i.ToString()));
oranges.Values.Add(rand.Next(100));
oranges.Tags.Add(i, new NFruitTag("Orange " + i.ToString()));
}
apples.MultiBarMode = MultiBarMode.Clustered;
oranges.MultiBarMode = MultiBarMode.Clustered;
chart.Series.Add(apples);
chart.Series.Add(oranges);
nChartControl1.Refresh();
}
private void nChartControl1_MouseClick(object sender, MouseEventArgs e)
{
NHitTestResult result = nChartControl1.HitTest(e.X, e.Y);
if (result.ChartElement == ChartElement.DataPoint)
{
NBarSeries bar = (NBarSeries)result.Series;
MessageBox.Show(((NFruitTag)bar.Tags[result.DataPointIndex]).m_Tag);
}
}
Is this the feature you're looking for?