|
Group: Forum Members
Posts: 30,
Visits: 1
|
Hi, I am using the following way to solve my problem.
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);
This could basically solve my problem when I call this method within the MouseMove event. But there is a small problem. If the user is panning the chart too quickly(throw the chart left/right), then the position of the textbox could not updated when the mouse is released. Same problem will happen if the user zoomed into the chart. The textbox will still stay at the original place. I think the problem might be the nChartControl1.View.Context is not updated when I call the method above when the mouse is released.
So my question is: Is there any event that will be raised if nChartControl1.View.Context is updated or the chart is shown?
Acutally, I found an event, which is nChartControl1.Paint. But I cannot figure out when this event is raised. Thank you very much.
Enjoyear
|