Hello experts,
Your method is working properly. Thank you very much for your code snippet.
Unfortunately it's still not solving my problem. I am afraid it might not be what I want.
Please see the attachment to better understand what I will talk about. I take a screen shot of those on the fly.
First of all, I add two textboxes to the nChartControl1. And Within the OnAfterPaint method, I update the position of all textboxes using the way I told you before.
_________ Copy those codes here ____________________
NScale2DToViewTransformation scaleToView =
new NScale2DToViewTransformation(nChartControl1.View.Context,
modelView.GetChartControl().Charts[0],
(int) StandardAxis.PrimaryX, (int) StandardAxis.PrimaryY);
NPointF point = new NPointF();
scaleToView.Transform(new NVector2DD(positionDataX, positionDataY), ref point);
TextBox.Location = new Point((int) point.X - TextBox.Size.Width/2, (int) point.Y + 5);
_____________________________________________________
But as long as the user is panning the chart only a little bit fast, what I will observe is that the chart stays at the same place, and only the position of the textboxes are updated. I guess I am not listening to the right event to update textbox positions.
Any idea how to solve this problem?
Many thanks!!
Best,
Enjoyear