/// <summary> /// init the chart viewer /// </summary> /// <param name="viewer">the instance of the viewer to init</param> private void initChartViewer(WinChartViewer viewer) { // set the x range if (showInFrame) { Console.WriteLine("data loaded in init chart viewer, index lenght: " + indexForFrame.Length); viewer.setFullRange("x", indexForFrame[0], indexForFrame[indexForFrame.Length - 1]); // init the view prot to show the latest 20% of the result viewer.ViewPortWidth = 0.2; viewer.ViewPortLeft = 1 - viewer.ViewPortWidth; // set the maximum zoom to 10 points viewer.ZoomInWidthLimit = 10.0 / indexForFrame.Length; } else { Console.WriteLine("data loaded in init chart viewer, index lenght: " + indexForSecond.Length); viewer.setFullRange("x", indexForSecond[0], indexForSecond[indexForSecond.Length - 1]); // init the view prot to show the latest 20% of the result viewer.ViewPortWidth = 0.2; viewer.ViewPortLeft = 1 - viewer.ViewPortWidth; // set the maximum zoom to 10 points viewer.ZoomInWidthLimit = 10.0 / indexForSecond.Length; } // init the set the mouse usage to "pointer" mode (drag to sroll mode) viewer.Dock = DockStyle.Fill; }
// // Initialize the WinChartViewer // private void initChartViewer(WinChartViewer viewer) { // Set the full x range to be the duration of the data viewer.setFullRange("x", timeStamps[0], timeStamps[timeStamps.Length - 1]); // Initialize the view port to show the latest 20% of the time range viewer.ViewPortWidth = 0.2; viewer.ViewPortLeft = 1 - viewer.ViewPortWidth; // Set the maximum zoom to 10 points viewer.ZoomInWidthLimit = 10.0 / timeStamps.Length; // Initially set the mouse usage to "Pointer" mode (Drag to Scroll mode) pointerPB.Checked = true; }