njz
njz

Reputation: 67

C# - Chart cursor not following mousepoint value

I have this issue where my chart cursor X is not following the mouse Point.

I have the code like this,

private void TrendChart_MouseMove(object sender, MouseEventArgs e)
 {
   Point mousePoint = new Point(e.X, e.Y);
   TrendChart.ChartAreas[0].CursorX.SetCursorPixelPosition(mousePoint, true);
   TrendChart.ChartAreas[0].CursorY.SetCursorPixelPosition(mousePoint, true);
 }

The result is like this :

My mouse is at left there but x cursor (vertical red line is at right)

Do you have any idea what could be the reason it's not following where my mouse is?

Upvotes: 2

Views: 1159

Answers (1)

njz
njz

Reputation: 67

Found the flaws. Have to change a Chart property: Cursor X Interval to be 0. Mine was Interval = 1.

ChartAreas properties

Upvotes: 2

Related Questions