protected void DrawTraceCustomAttributes(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis, int indexStart, int indexStop)
        {
            PlotDataPointCubicSpline plotDataPointCubicSpline  = new PlotDataPointCubicSpline(this);
            PlotDataPointCubicSpline plotDataPointCubicSpline2 = new PlotDataPointCubicSpline(this);
            double num  = this.GetX(indexStart);
            double num2 = this.GetX(indexStop);

            if (num < xAxis.Min)
            {
                num = base.XAxis.Min;
            }
            if (num2 > xAxis.Max)
            {
                num2 = base.XAxis.Max;
            }
            int num3 = xAxis.ValueToPixels(num);
            int num4 = xAxis.ValueToPixels(num2);

            if (num3 > num4)
            {
                Math2.Switch(ref num3, ref num4);
            }
            Brush  brush = ((IPlotBrush)this.Fill.Brush).GetBrush(p, base.BoundsClip);
            double num5  = xAxis.PixelsToValue(num3);

            this.SplineInterpolation(indexStart, base.IndexLast, num5, out double num6);
            double x = num5;
            double y = num6;

            for (int i = num3; i <= num4; i++)
            {
                num5 = base.XAxis.PixelsToValue(i);
                this.SplineInterpolation(indexStart, base.IndexLast, num5, out num6);
                int num7 = i - this.m_XPixelMin;
                if (num7 >= 0 && num7 < this.m_PixelYValues.Length)
                {
                    this.m_PixelYValues[i - this.m_XPixelMin] = num6;
                }
                double num8 = num5;
                double num9 = num6;
                base.DataPointInitializing  = true;
                plotDataPointCubicSpline.X  = x;
                plotDataPointCubicSpline.Y  = y;
                plotDataPointCubicSpline2.X = num8;
                plotDataPointCubicSpline2.Y = num9;
                base.DataPointInitializing  = false;
                this.DrawLine(p, xAxis, yAxis, this.I_Trace.GetPen(p), plotDataPointCubicSpline, plotDataPointCubicSpline2, brush);
                x = num8;
                y = num9;
            }
        }
Example #2
0
        protected void DrawTraceCustomAttributes(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis)
        {
            PlotDataPointRational plotDataPointRational  = new PlotDataPointRational(this);
            PlotDataPointRational plotDataPointRational2 = new PlotDataPointRational(this);
            double num  = this.GetX(0);
            double num2 = this.GetX(this.Count - 1);

            if (num < xAxis.Min)
            {
                num = base.XAxis.Min;
            }
            if (num2 > xAxis.Max)
            {
                num2 = base.XAxis.Max;
            }
            int num3 = xAxis.ValueToPixels(num);
            int num4 = xAxis.ValueToPixels(num2);

            if (num3 > num4)
            {
                Math2.Switch(ref num3, ref num4);
            }
            Brush  brush = ((IPlotBrush)this.Fill.Brush).GetBrush(p, base.BoundsClip);
            double num5  = xAxis.PixelsToValue(num3);

            this.RationalInterpolation(this.Count, num5, out double num6, out double num7);
            double x = num5;
            double y = num6;

            for (int i = num3; i <= num4; i++)
            {
                num5 = base.XAxis.PixelsToValue(i);
                this.RationalInterpolation(this.Count, num5, out num6, out num7);
                int num8 = i - this.m_XPixelMin;
                if (num8 >= 0 && num8 < this.m_PixelYValues.Length)
                {
                    this.m_PixelYValues[i - this.m_XPixelMin] = num6;
                }
                double num9  = num5;
                double num10 = num6;
                base.DataPointInitializing = true;
                plotDataPointRational.X    = x;
                plotDataPointRational.Y    = y;
                plotDataPointRational2.X   = num9;
                plotDataPointRational2.Y   = num10;
                base.DataPointInitializing = false;
                this.DrawLine(p, xAxis, yAxis, this.I_Trace.GetPen(p), plotDataPointRational, plotDataPointRational2, brush);
                x = num9;
                y = num10;
            }
        }
Example #3
0
        protected override void Draw(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis)
        {
            this.m_FillRefPixel = yAxis.ValueToPixels(this.Reference);
            this.m_XPixelMin    = xAxis.ValueToPixels(xAxis.Min);
            this.m_XPixelMax    = xAxis.ValueToPixels(xAxis.Max);
            if (this.m_XPixelMax < this.m_XPixelMin)
            {
                Math2.Switch(ref this.m_XPixelMax, ref this.m_XPixelMin);
            }
            int num = this.m_XPixelMax - this.m_XPixelMin;

            if (num < 1)
            {
                this.m_PixelYValues = null;
            }
            else
            {
                if (this.m_PixelYValues == null)
                {
                    this.m_PixelYValues = new double[num];
                }
                if (this.m_PixelYValues.Length != num)
                {
                    this.m_PixelYValues = new double[num];
                }
            }
            if (this.m_PixelYValues != null)
            {
                for (int i = 0; i < this.m_PixelYValues.Length; i++)
                {
                    this.m_PixelYValues[i] = 1E+305;
                }
            }
            if (this.Trace.Visible && this.Count > 1)
            {
                this.DrawTraceCustomAttributes(p, xAxis, yAxis);
            }
            this.DrawMarkers(p, xAxis, yAxis, this.Markers);
        }
Example #4
0
        private void DrawColorBar(PaintArgs p, double start, double stop, Color color)
        {
            start = base.ValueClamped(start);
            stop  = base.ValueClamped(stop);
            int edgeRef = base.EdgeRef;
            int num     = this.ValueToPixels(stop);
            int num2    = this.ValueToPixels(start);
            int length  = base.TickMajor.Length;

            if (num2 < num)
            {
                Math2.Switch(ref num2, ref num);
            }
            if (this.Direction == SideDirection.LeftToRight)
            {
                Rectangle rect = new Rectangle(edgeRef, num, length, num2 - num);
                p.Graphics.FillRectangle(p.Graphics.Brush(color), rect);
            }
            else
            {
                Rectangle rect = new Rectangle(edgeRef - length, num, length, num2 - num);
                p.Graphics.FillRectangle(p.Graphics.Brush(color), rect);
            }
        }
        protected override void Draw(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis)
        {
            this.m_FillRefPixel = yAxis.ValueToPixels(this.Reference);
            this.m_XPixelMin    = xAxis.ValueToPixels(xAxis.Min);
            this.m_XPixelMax    = xAxis.ValueToPixels(xAxis.Max);
            if (this.m_XPixelMax < this.m_XPixelMin)
            {
                Math2.Switch(ref this.m_XPixelMax, ref this.m_XPixelMin);
            }
            int num = this.m_XPixelMax - this.m_XPixelMin;

            if (num < 1)
            {
                this.m_PixelYValues = null;
            }
            else
            {
                if (this.m_PixelYValues == null)
                {
                    this.m_PixelYValues = new double[num];
                }
                if (this.m_PixelYValues.Length != num)
                {
                    this.m_PixelYValues = new double[num];
                }
            }
            if (this.m_PixelYValues != null)
            {
                for (int i = 0; i < this.m_PixelYValues.Length; i++)
                {
                    this.m_PixelYValues[i] = 1E+305;
                }
            }
            if (this.Trace.Visible && this.Count > 1)
            {
                int j    = 0;
                int num2 = 0;
                int num3 = 0;
                for (; j < this.Count; j++)
                {
                    if (this[j].Null)
                    {
                        if (num3 - num2 > 1)
                        {
                            this.SplineCalculations(num3 - num2 + 1, num2, num2 + 1, num3, num3 - 1);
                            this.DrawTraceCustomAttributes(p, xAxis, yAxis, num2, num3);
                            num2 = j + 1;
                            num3 = num2;
                        }
                    }
                    else
                    {
                        num3 = j;
                    }
                }
                if (num3 - num2 > 1)
                {
                    this.SplineCalculations(num3 - num2 + 1, num2, num2 + 1, num3, num3 - 1);
                    this.DrawTraceCustomAttributes(p, xAxis, yAxis, num2, num3);
                }
            }
            this.DrawMarkers(p, xAxis, yAxis, this.Markers);
        }