Scaling and selection do not work for C # chart with X axis of type Time

I use the following code so that I can select and scale my parts of the diagram:

chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true;

chart1.ChartAreas[0].CursorY.IsUserEnabled = true;
chart1.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
chart1.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
chart1.ChartAreas[0].AxisY.ScrollBar.IsPositionedInside = true;

It works for a chart with x and y axes of type Integer.

enter image description here

But when I set the value type of the series series1.XValueType = ChartValueType.Time;, I will not increase the x axis.

enter image description here

When I set the types of axis values ​​for a car and add points using, for example chart1.Series[0].Points.AddXY(DateTime.Now.ToLongTimeString(), rand.Next(10, 20));, then scaling works.

How can I x axis be time and still be scalable?

+5
source share
2 answers

, , , . . start == end, - .

+2

, 1,0, , 0,01, , 1%, . IntervalType , datetime.

chart1.ChartAreas[0].CursorX.Interval = 0.01

http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.cursor.interval%28v=vs.100%29.aspx

+12

All Articles