Exemple #1
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);
        }
Exemple #2
0
        private void Dbuffer_MouseMove(object sender, MouseEventArgs e)
        {
            bool fineControlNow = ChartViewer.IsModifierHeld(Keys.Shift);

            if (fineControlNow != fineControl)
            {
                mX = e.X; mY = e.Y; fcX = vX; fcY = vY;
            }
            fineControl = fineControlNow;
            if (fineControl)
            {
                vX = fcX + (e.X - mX) / 5; vY = fcY + (e.Y - mY) / 5;
            }
            else
            {
                vX = fcX + (e.X - mX); vY = fcY + (e.Y - mY);
            }
            double x = scrolledDoubleBuffer1.Screen2dataX(vX);
            double y = scrolledDoubleBuffer1.Screen2dataY(vY);



            if (moveShadow)
            {
                int dX = vX - startX;
                int dY = vY - startY;
                settings.ShadowOffset.X = startShadowX + dX / zoomF;
                settings.ShadowOffset.Y = startShadowY + dY / zoomF;
                dbuffer.Refresh();
            }
            else if (moveWholePic)
            {
                int dX = vX - startX;
                int dY = vY - startY;
                x = scrolledDoubleBuffer1.Screen2dataX((int)startPt.X + dX);
                y = scrolledDoubleBuffer1.Screen2dataY((int)startPt.Y + dY);
                settings.PicCorner = new PointD(x, y);
                _geometryUpdate();
                dbuffer.Refresh();
            }
            else if (pbActive != null)
            {
                pbActive.Points[activeIdx].X = x;
                pbActive.Points[activeIdx].Y = y;
                pbActive.Refresh();
                _geometryUpdate();
                dbuffer.Refresh();
            }
            else if (auxActive != null)
            {
                auxActive.X = x;
                auxActive.Y = y;
                _geometryUpdate();
                dbuffer.Refresh();
            }
        }
Exemple #3
0
        public string DefineDesigner(ChartViewer ChartViewerParam)
        {
            ChartViewer ChartViewer = ChartViewerParam;

            if (ChartViewerParam != null)
            {
                ChartViewer = new ChartViewer();
            }

            if (Cad_Report.Code_Chart != null)
            {
                XmlDocument docXML = new XmlDocument();
                docXML.LoadXml(System.Text.ASCIIEncoding.UTF8.GetString(Utils.Compact_Data.Descompactar(Cad_Report.Code_Chart, string.Empty)));
                ChartViewer.ChartStream = docXML.InnerXml;
            }

            ChartViewer.RunDesigner();

            return(ChartViewer.ChartStream);
        }