示例#1
0
 private void winChartViewer1_ViewPortChanged_1(object sender, WinViewPortEventArgs e)
 {
     if (e.NeedUpdateChart)
     {
         drawChart(winChartViewer1, dataHeart_rate, 0xff2222, false);
     }
 }
示例#2
0
 private void winChartViewer2_ViewPortChanged_1(object sender, WinViewPortEventArgs e)
 {
     if (e.NeedUpdateChart)
     {
         drawChart(winChartViewer2, dataTem_rate, 0xfffa2b, false);
     }
 }
示例#3
0
        /// <summary>
        /// The ViewPortChanged event handler. This event occurs when the user changes the
        /// WinChartViewer view port by dragging scrolling, or by zoom in/out, or the
        /// WinChartViewer.updateViewPort method is being called.
        /// </summary>
        private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            if (!navigateWindow.Capture)
            {
                // We need to update the navigator window size and position only if the view port
                // changes are not caused by the navigateWindow itself.
                navigateWindow.Left = (int)Math.Round(winChartViewer1.ViewPortLeft *
                                                      navigatePad.ClientSize.Width);
                navigateWindow.Top = (int)Math.Round(winChartViewer1.ViewPortTop *
                                                     navigatePad.ClientSize.Height);
                navigateWindow.Width = (int)Math.Max(1.0, winChartViewer1.ViewPortWidth *
                                                     navigatePad.ClientSize.Width);
                navigateWindow.Height = (int)Math.Max(1.0, winChartViewer1.ViewPortHeight *
                                                      navigatePad.ClientSize.Height);
            }

            // Synchronize the zoom bar value with the view port width/height
            zoomBar.Value = (int)Math.Round(Math.Min(winChartViewer1.ViewPortWidth,
                                                     winChartViewer1.ViewPortHeight) * zoomBar.Maximum);

            // Update chart and image map if necessary
            if (e.NeedUpdateChart)
            {
                drawChart(winChartViewer1);
            }
            if (e.NeedUpdateImageMap)
            {
                updateImageMap(winChartViewer1);
            }
        }
示例#4
0
        private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            // In addition to updating the chart, we may also need to update other controls that
            // changes based on the view port.
            updateControls(winChartViewer1);

            // Update the chart if necessary
            if (e.NeedUpdateChart)
            {
                createChart();
            }

            if (e.NeedUpdateImageMap)
            {
                updateImageMap(winChartViewer1);
            }

            // We need to update the track line too. If the mouse is moving on the chart (eg. if
            // the user drags the mouse on the chart to scroll it), the track line will be updated
            // in the MouseMovePlotArea event. Otherwise, we need to update the track line here.
            //if (!winChartViewer1.IsInMouseMoveEvent)
            //{
            //    //trackLineLegend((XYChart)winChartViewer1.Chart, winChartViewer1.PlotAreaMouseX);
            //    winChartViewer1.updateDisplay();
            //}
        }
示例#5
0
        private void ChartViewer_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            if (!e.NeedUpdateChart)
            {
                return;
            }
            double dn = algorythm.Nmax - algorythm.Nmin;

            algorythm.Nmin += dn * ChartViewer.ViewPortLeft;
            algorythm.Nmax  = algorythm.Nmin + dn * ChartViewer.ViewPortWidth;

            double dd = algorythm.Dmax - algorythm.Dmin;

            algorythm.Dmax -= dd * ChartViewer.ViewPortTop;
            algorythm.Dmin  = algorythm.Dmax - dd * ChartViewer.ViewPortHeight;
            fieldsList["Nmin"].syncTo();
            fieldsList["Nmax"].syncTo();
            fieldsList["Dmin"].syncTo();
            fieldsList["Dmax"].syncTo();
            ChartViewer.ViewPortHeight = 1;
            ChartViewer.ViewPortLeft   = 0;
            ChartViewer.ViewPortTop    = 0;
            ChartViewer.ViewPortWidth  = 1;
            ChartViewer.updateViewPort(false, false);
        }
 //
 // The ViewPortChanged event handler. This event occurs if the user scrolls or zooms in
 // or out the chart by dragging or clicking on the chart. It can also be triggered by
 // calling WinChartViewer.updateViewPort.
 //
 private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
 {
     // Update the chart if necessary
     if (e.NeedUpdateChart)
     {
         drawChart(winChartViewer1);
     }
 }
 //
 // The ViewPortChanged event handler. This event occurs if the user scrolls or zooms in
 // or out the chart by dragging or clicking on the chart. It can also be triggered by
 // calling WinChartViewer.updateViewPort.
 //
 private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
 {
     if (e.NeedUpdateChart)
     {
         drawChart(winChartViewer1);
     }
     if (e.NeedUpdateImageMap)
     {
         updateImageMap(winChartViewer1);
     }
 }
示例#8
0
        //
        // The ViewPortChanged event handler
        //
        private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            // In addition to updating the chart, we may also need to update other controls that
            // changes based on the view port.
            updateControls(winChartViewer1);

            // Update the chart if necessary
            if (e.NeedUpdateChart)
            {
                drawChart(winChartViewer1);
            }
        }
示例#9
0
 private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
 {
     try
     {
         drawChart(winChartViewer1);
     }
     catch (Exception ioe)
     {
         //Console.WriteLine(ioe);
         MessageBox.Show(ioe.ToString());
     }
 }
        // the ViewportChanged event handle, this event occurs if the user scrolls or zooms in or out the chart by dragging or clicking on th echart. it can also be triggered by calling WinChartViewer.updateViewPort
        private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            // in addition to updating the chart , we may also need to updata other controls that changeds based on the view port
            updateControls(winChartViewer1);

            // update the chart if necessary
            if (e.NeedUpdateChart)
            {
                drawChart(winChartViewer1);
            }

            if ((!winChartViewer1.IsInMouseMoveEvent))
            {
                trackLineLabel((XYChart)winChartViewer1.Chart, winChartViewer1.PlotAreaMouseX);
                winChartViewer1.updateDisplay();
            }
        }
示例#11
0
        private void chartViewer_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            for (int i = 0; i < GX.Count; i++)
            {
                if (GX[i] != null && GY[i] != null && GZ[i] != null)
                {
                    String sfx = GX[i].ToString();
                    float  fx  = Convert.ToSingle(sfx) - Convert.ToSingle(f1.textBox1.Text);
                    String sfy = GY[i].ToString();
                    float  fy  = Convert.ToSingle(sfy) - Convert.ToSingle(f1.textBox2.Text);
                    String sfz = GZ[i].ToString();
                    float  fz  = Convert.ToSingle(sfz) - Convert.ToSingle(f1.textBox3.Text);

                    ch.AddPointChart(chartViewer, fx, fy, fz);
                    ch.createChart(chartViewer, 1, 0, 10);
                }
            }
            ch.createChart(chartViewer, 1, 0, 10);
        }
示例#12
0
        /// <summary>
        /// The ViewPortChanged event handler. This event occurs when the user changes the
        /// WinChartViewer view port by dragging scrolling, or by zoom in/out, or the
        /// WinChartViewer.updateViewPort method is being called.
        /// </summary>
        private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
        {
            // Compute the view port start date and duration
            DateTime currentStartDate = minDate.AddSeconds(Math.Round(winChartViewer1.ViewPortLeft * dateRange));

            currentDuration = Math.Round(winChartViewer1.ViewPortWidth * dateRange);

            // Synchronize the startDate and duration controls
            startDate.Value = currentStartDate;
            duration.Text   = Math.Round(currentDuration / 86400).ToString();

            // Synchronize the horizontal scroll bar with the WinChartViewer
            hScrollBar1.Enabled     = winChartViewer1.ViewPortWidth < 1;
            hScrollBar1.LargeChange = (int)Math.Ceiling(winChartViewer1.ViewPortWidth *
                                                        (hScrollBar1.Maximum - hScrollBar1.Minimum));
            hScrollBar1.SmallChange = (int)Math.Ceiling(hScrollBar1.LargeChange * 0.1);
            hScrollBar1.Value       = (int)Math.Round(winChartViewer1.ViewPortLeft *
                                                      (hScrollBar1.Maximum - hScrollBar1.Minimum)) + hScrollBar1.Minimum;

            // Synchronize the vertical scroll bar with the WinChartViewer
            vScrollBar1.Enabled     = winChartViewer1.ViewPortHeight < 1;
            vScrollBar1.LargeChange = (int)Math.Ceiling(winChartViewer1.ViewPortHeight *
                                                        (vScrollBar1.Maximum - vScrollBar1.Minimum));
            vScrollBar1.SmallChange = (int)Math.Ceiling(vScrollBar1.LargeChange * 0.1);
            vScrollBar1.Value       = (int)Math.Round(winChartViewer1.ViewPortTop *
                                                      (vScrollBar1.Maximum - vScrollBar1.Minimum)) + vScrollBar1.Minimum;

            // Update chart and image map if necessary
            if (e.NeedUpdateChart)
            {
                drawChart(winChartViewer1);
            }
            if (e.NeedUpdateImageMap)
            {
                updateImageMap(winChartViewer1);
            }
        }
 //
 // The viewPortChanged event handler. In this example, it just updates the chart. If you
 // have other controls to update, you may also put the update code here.
 //
 private void winChartViewer1_ViewPortChanged(object sender, WinViewPortEventArgs e)
 {
     drawChart(winChartViewer1);
 }
示例#14
0
 private void chartViewer_ViewPortChanged(object sender, WinViewPortEventArgs e)
 {
     th.AddPointChart(chartViewer, int.Parse(textBox1.Text), int.Parse(textBox2.Text), int.Parse(textBox3.Text));
     th.createChart(chartViewer, 1, 0, 100);
 }
示例#15
0
        private void winChartViewer1_ViewPortChanged_1(object sender, WinViewPortEventArgs e)
        {
            // Synchronize the horizontal scroll bar with the WinChartViewer
            hScrollBar1.Enabled = winChartViewer1.ViewPortWidth < 1;
            hScrollBar1.LargeChange = (int)Math.Ceiling(winChartViewer1.ViewPortWidth *
                (hScrollBar1.Maximum - hScrollBar1.Minimum));
            hScrollBar1.SmallChange = (int)Math.Ceiling(hScrollBar1.LargeChange * 0.1);
            hScrollBar1.Value = (int)Math.Round(winChartViewer1.ViewPortLeft *
                (hScrollBar1.Maximum - hScrollBar1.Minimum)) + hScrollBar1.Minimum;

            // Synchronize the vertical scroll bar with the WinChartViewer
            vScrollBar1.Enabled = winChartViewer1.ViewPortHeight < 1;
            vScrollBar1.LargeChange = (int)Math.Ceiling(winChartViewer1.ViewPortHeight *
                (vScrollBar1.Maximum - vScrollBar1.Minimum));
            vScrollBar1.SmallChange = (int)Math.Ceiling(vScrollBar1.LargeChange * 0.1);
            vScrollBar1.Value = (int)Math.Round(winChartViewer1.ViewPortTop *
                (vScrollBar1.Maximum - vScrollBar1.Minimum)) + vScrollBar1.Minimum;

            // Update chart and image map if necessary
            if (e.NeedUpdateChart)
                drawChart(winChartViewer1);
            if (e.NeedUpdateImageMap)
                updateImageMap(winChartViewer1);
        }