예제 #1
0
        private void reevaluateLiveYAxes()
        {
            if (chart1.Series[0].Points.Count > 0)
            {
                chart1.ChartAreas[0].AxisX.Minimum = chart1.Series[0].Points[0].XValue;
                chart1.ChartAreas[0].AxisX.Maximum = chart1.Series[0].Points[chart1.Series[0].Points.Count - 1].XValue;
            }

            int selected = logger.systemLog.getSelectedInstanceIndex();

            if (selected != -1)
            {
                AxisRange r = logger.systemLog.selectedInstance.GetLiveYAxisRange();
                chart1.ChartAreas[0].AxisY.Minimum            = r.lower;
                chart1.ChartAreas[0].AxisY.Maximum            = r.higher;
                chart1.ChartAreas[0].AxisY.MajorGrid.Interval = r.higher / 4.0;
                chart1.ChartAreas[0].AxisY.Interval           = r.higher / 4.0;
            }
            else
            {
                Debug.WriteLine("not selected");
            }
        }
예제 #2
0
        private void reevaluateHistoryAxes(DateTime position, TimeSpan width)
        {
            int selected = logger.systemLog.getSelectedInstanceIndex();

            if (selected != -1)
            {
                AxisRange r = logger.systemLog.selectedInstance.GetHistoryYAxisRange();
                chart2.ChartAreas[0].AxisY.Minimum            = r.lower;
                chart2.ChartAreas[0].AxisY.Maximum            = r.higher;
                chart2.ChartAreas[0].AxisY.MajorGrid.Interval = r.higher / 4.0;
                chart2.ChartAreas[0].AxisY.Interval           = r.higher / 4.0;

                Series rangeSeries = new Series();
                rangeSeries.Points.AddXY(position, 0);
                rangeSeries.Points.AddXY(position + width, 0);
                chart2.ChartAreas[0].AxisX.Minimum = rangeSeries.Points[0].XValue;
                chart2.ChartAreas[0].AxisX.Maximum = rangeSeries.Points[1].XValue;
            }
            else
            {
                Debug.WriteLine("not selected");
            }
        }