Hi Alex,
Yes - in this case you need to modify the FillStyles/BorderStyles collection of the bar series. Check this code:
private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.Values.Add(20);
bar.Values.Add(30);
chart.Series.Add(bar);
nChartControl1.MouseDown += new MouseEventHandler(nChartControl1_MouseDown);
}
void nChartControl1_MouseDown(object sender, MouseEventArgs e)
{
NHitTestResult result = nChartControl1.HitTest(e.X, e.Y);
if (result.ChartElement == ChartElement.DataPoint)
{
NBarSeries bar = result.Series as NBarSeries;
bar.FillStyles.Clear();
bar.BorderStyles.Clear();
bar.FillStyles[result.DataPointIndex] = new NColorFillStyle(Color.Red);
bar.BorderStyles[result.DataPointIndex] = new NStrokeStyle(2, Color.Orange);
nChartControl1.Refresh();
}
}
It will dynamically highlight the clicked bar...
Best Regards,
Nevron Support Team