Esempio n. 1
0
 public void UpdateMinMaxMean(PlotDataPointYDouble dataPoint)
 {
     if ((dataPoint.Empty || dataPoint.Null) && this.XValueNotValidWhenEmptyOrNull)
     {
         return;
     }
     this.m_XMeanCount++;
     this.m_XMeanSum += dataPoint.X;
     this.m_XMean     = this.m_XMeanSum / (double)this.m_XMeanCount;
     this.m_XMin      = Math.Min(this.m_XMin, dataPoint.X);
     this.m_XMax      = Math.Max(this.m_XMax, dataPoint.X);
     if (!dataPoint.Empty && !dataPoint.Null)
     {
         this.m_YMeanCount++;
         this.m_YMeanSum += dataPoint.Y;
         this.m_YMean     = this.m_YMeanSum / (double)this.m_YMeanCount;
         this.m_YMin      = Math.Min(this.m_YMin, dataPoint.Y);
         this.m_YMax      = Math.Max(this.m_YMax, dataPoint.Y);
     }
 }
Esempio n. 2
0
        public void UpdateStandardDeviations()
        {
            this.m_XStandardDeviation = 0.0;
            this.m_YStandardDeviation = 0.0;
            if (this.Count != 0)
            {
                PlotDataPointYDouble plotDataPointYDouble = this[0] as PlotDataPointYDouble;
                if (plotDataPointYDouble != null)
                {
                    double num  = 0.0;
                    double num2 = 0.0;
                    int    num3 = 0;
                    int    num4 = 0;
                    for (int i = 0; i < this.Count; i++)
                    {
                        plotDataPointYDouble = (this[i] as PlotDataPointYDouble);
                        if (!plotDataPointYDouble.Empty && !plotDataPointYDouble.Null)
                        {
                            goto IL_0083;
                        }
                        if (!this.XValueNotValidWhenEmptyOrNull)
                        {
                            goto IL_0083;
                        }
                        continue;
IL_0083:
                        num += (this.XMean - plotDataPointYDouble.X) * (this.XMean - plotDataPointYDouble.X);
                        num3++;
                        if (!plotDataPointYDouble.Empty && !plotDataPointYDouble.Null)
                        {
                            num2 += (this.YMean - plotDataPointYDouble.Y) * (this.YMean - plotDataPointYDouble.Y);
                            num4++;
                        }
                    }
                    num  /= (double)num3;
                    num2 /= (double)num4;
                    this.m_XStandardDeviation = Math.Sqrt(num);
                    this.m_YStandardDeviation = Math.Sqrt(num2);
                }
            }
        }
Esempio n. 3
0
        protected void DrawLine(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis, Pen pen, PlotDataPointYDouble point1, PlotDataPointYDouble point2, Brush fillBrush)
        {
            int num  = xAxis.ScaleDisplay.ValueToPixels(point1.X);
            int num2 = yAxis.ScaleDisplay.ValueToPixels(point1.Y);
            int num3 = xAxis.ScaleDisplay.ValueToPixels(point2.X);
            int num4 = yAxis.ScaleDisplay.ValueToPixels(point2.Y);

            if (base.XYSwapped)
            {
                p.Graphics.DrawLine(pen, num2, num, num4, num3);
            }
            else
            {
                p.Graphics.DrawLine(pen, num, num2, num3, num4);
            }
            if (this.Fill.Visible && this.Fill.Brush.Visible)
            {
                if (this.m_FillPoints == null)
                {
                    this.m_FillPoints = new Point[4];
                }
                if (base.XYSwapped)
                {
                    this.m_FillPoints[0].X = this.m_FillRefPixel;
                    this.m_FillPoints[0].Y = num;
                }
                else
                {
                    this.m_FillPoints[0].X = num;
                    this.m_FillPoints[0].Y = this.m_FillRefPixel;
                }
                if (base.XYSwapped)
                {
                    this.m_FillPoints[1].X = num2;
                    this.m_FillPoints[1].Y = num;
                }
                else
                {
                    this.m_FillPoints[1].X = num;
                    this.m_FillPoints[1].Y = num2;
                }
                if (base.XYSwapped)
                {
                    this.m_FillPoints[2].X = num4;
                    this.m_FillPoints[2].Y = num3;
                }
                else
                {
                    this.m_FillPoints[2].X = num3;
                    this.m_FillPoints[2].Y = num4;
                }
                if (base.XYSwapped)
                {
                    this.m_FillPoints[3].X = this.m_FillRefPixel;
                    this.m_FillPoints[3].Y = num3;
                }
                else
                {
                    this.m_FillPoints[3].X = num3;
                    this.m_FillPoints[3].Y = this.m_FillRefPixel;
                }
                p.Graphics.FillPolygon(fillBrush, this.m_FillPoints);
            }
        }
Esempio n. 4
0
 public void AddDataPoint(PlotDataPointYDouble dataPoint)
 {
     if (!dataPoint.Empty)
     {
         if (dataPoint.Null)
         {
             this.DrawFlush();
         }
         else
         {
             int num  = this.m_XAxis.ScaleDisplay.ValueToPixels(dataPoint.X);
             int num2 = this.m_YAxis.ScaleDisplay.ValueToPixels(dataPoint.Y);
             if (this.m_Empty)
             {
                 this.m_PixelXLast = num;
                 this.m_PixelYMin  = num2;
                 this.m_PixelYMax  = num2;
                 this.m_PixelYLast = num2;
                 this.m_Empty      = false;
             }
             else if (num == this.m_PixelXLast && num2 != this.m_PixelYLast)
             {
                 this.m_PixelYMin     = Math.Min(this.m_PixelYMin, num2);
                 this.m_PixelYMax     = Math.Max(this.m_PixelYMax, num2);
                 this.m_PixelYLast    = num2;
                 this.m_HighLowCached = true;
             }
             else
             {
                 if (this.m_HighLowCached)
                 {
                     this.CleanupHighLowCached();
                 }
                 if (this.m_PixelYLast == num2)
                 {
                     this.m_PixelXNext       = num;
                     this.m_HorizontalCached = true;
                 }
                 else
                 {
                     if (this.m_HorizontalCached)
                     {
                         this.CleanupHorizontalCached();
                     }
                     if (this.TraceVisible)
                     {
                         if (this.XYSwapped)
                         {
                             this.P.Graphics.DrawLine(this.m_Pen, this.m_PixelYLast, this.m_PixelXLast, num2, num);
                         }
                         else
                         {
                             this.P.Graphics.DrawLine(this.m_Pen, this.m_PixelXLast, this.m_PixelYLast, num, num2);
                         }
                     }
                     if (this.FillVisible)
                     {
                         if (this.m_Points == null)
                         {
                             this.m_Points = new Point[4];
                         }
                         if (this.XYSwapped)
                         {
                             this.m_Points[0].X = this.m_FillRefPixel;
                             this.m_Points[0].Y = this.m_PixelXLast;
                             this.m_Points[1].X = this.m_PixelYLast;
                             this.m_Points[1].Y = this.m_PixelXLast;
                             this.m_Points[2].X = num2;
                             this.m_Points[2].Y = num;
                             this.m_Points[3].X = this.m_FillRefPixel;
                             this.m_Points[3].Y = num;
                         }
                         else
                         {
                             this.m_Points[0].X = this.m_PixelXLast;
                             this.m_Points[0].Y = this.m_FillRefPixel;
                             this.m_Points[1].X = this.m_PixelXLast;
                             this.m_Points[1].Y = this.m_PixelYLast;
                             this.m_Points[2].X = num;
                             this.m_Points[2].Y = num2;
                             this.m_Points[3].X = num;
                             this.m_Points[3].Y = this.m_FillRefPixel;
                         }
                         this.P.Graphics.FillPolygon(this.FillBrush, this.m_Points);
                     }
                     this.m_PixelXLast = num;
                     this.m_PixelYMin  = num2;
                     this.m_PixelYMax  = num2;
                     this.m_PixelYLast = num2;
                 }
             }
         }
     }
 }