locked
Zoom in a chart RRS feed

  • Question

  • Hi guy,

    i'm realizing an application to create a chart and make it zoomable. I have enabled this function and all run well,but

    when i zoom in the chart on the axis appear values with more numbers after the point,and i don't want see all this numbers.

    How can i resolve this?! i use Visual studio 2015 community.

            private void chart1_MouseMove(object sender, MouseEventArgs e)
            {
                Point mousep = new Point(e.X, e.Y);           
                chart1.ChartAreas[0].CursorX.Interval = 0;
                chart1.ChartAreas[0].CursorY.Interval = 0;
                chart1.ChartAreas[0].CursorX.SetCursorPixelPosition(mousep, true);
                chart1.ChartAreas[0].CursorY.SetCursorPixelPosition(mousep, true);
                label16.Text = "X: " + Convert.ToString(Math.Round(chart1.ChartAreas[0].CursorX.Position, 2));
                label17.Text = "Y: " + Convert.ToString(Math.Round(chart1.ChartAreas[0].CursorY.Position, 2));
            }

    This is my code to visualize the cursors and their position on two label.

    Thanks,

    Ivan

    • Edited by Ivan Msdn Wednesday, December 16, 2015 11:11 PM
    • Moved by Greazer Thursday, December 17, 2015 11:53 PM
    Wednesday, December 16, 2015 11:10 PM