Hi Plamen,
Yes - in this case you have to implement the following steps:
1. Intercept the mouse move event fired by the control.
2. Transform the passed view coordinates to scale coordinates.
The following code snippet shows how to achieve this:
private void Form1_Load(object sender, EventArgs e)
{
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
chart.MinDockZoneMargins = new NMarginsL(45, 0, 0, 0);
NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.Values.Add(20);
bar.Values.Add(30);
chart.Series.Add(bar);
nChartControl1.MouseMove += new MouseEventHandler(nChartControl1_MouseMove);
}
void nChartControl1_MouseMove(object sender, MouseEventArgs e)
{
NHitTestResult result = nChartControl1.HitTest(e.X, e.Y);
if (result.Chart != null)
{
NCartesianChart chart = (NCartesianChart)result.Chart;
NStandardScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NStandardScaleConfigurator;
scale.CustomLabels.Clear();
NViewToScale2DTransformation transform = new NViewToScale2DTransformation(nChartControl1.View.Context, chart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY);
NPointF point = new NPointF(e.X, e.Y);
NVector2DD pointScale = new NVector2DD();
transform.Transform(point, ref pointScale);
NCustomValueLabel label = new NCustomValueLabel();
label.Value = pointScale.Y;
label.Text = label.Value.ToString("N2");
scale.CustomLabels.Add(label);
nChartControl1.Refresh();
}
}
Hope this helps - let us know if you meet any problems or have any questions.
Best Regards,
Nevron Support Team