コード例 #1
0
ファイル: PlotChannelBubble.cs プロジェクト: fxxxysh/toolkit
        private int AddXY(double x, double y, bool nullValue, bool emptyValue, double radius)
        {
            if (this.RequireConsecutiveData)
            {
                base.CheckForValidNextX(x);
            }
            PlotDataPointBubble plotDataPointBubble = (PlotDataPointBubble)base.m_Data.AddNew();

            base.DataPointInitializing = true;
            try
            {
                plotDataPointBubble.X      = x;
                plotDataPointBubble.Y      = y;
                plotDataPointBubble.Null   = nullValue;
                plotDataPointBubble.Empty  = emptyValue;
                plotDataPointBubble.Radius = radius;
            }
            finally
            {
                base.DataPointInitializing = false;
            }
            base.m_Data.UpdateMinMaxMean(plotDataPointBubble);
            if (base.SendXAxisTrackingData)
            {
                PlotAxis xAxis = base.XAxis;
                if (xAxis != null)
                {
                    xAxis.Tracking.NewData(x - radius);
                    xAxis.Tracking.NewData(x + radius);
                }
            }
            if (!nullValue && !emptyValue && base.SendYAxisTrackingData)
            {
                PlotAxis yAxis = base.YAxis;
                if (yAxis != null)
                {
                    yAxis.Tracking.NewData(y + radius);
                    yAxis.Tracking.NewData(y - radius);
                }
            }
            this.DoDataChange();
            return(base.m_Data.LastNewDataPointIndex);
        }
コード例 #2
0
ファイル: PlotChannelBubble.cs プロジェクト: fxxxysh/toolkit
 protected override void Draw(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis)
 {
     for (int i = this.IndexDrawStart; i <= this.IndexDrawStop; i++)
     {
         PlotDataPointBubble plotDataPointBubble = this[i];
         if (!plotDataPointBubble.Empty && !plotDataPointBubble.Null)
         {
             int left;
             int right;
             int top;
             int bottom;
             if (this.RadiusStyle == PlotChannelBubbleRadiusStyle.SizeY)
             {
                 int num = yAxis.ScaleDisplay.ValueToSpanPixels(plotDataPointBubble.Radius);
                 left   = xAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.X) - num;
                 right  = xAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.X) + num;
                 top    = yAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.Y) - num;
                 bottom = yAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.Y) + num;
             }
             else if (this.RadiusStyle == PlotChannelBubbleRadiusStyle.SizeX)
             {
                 int num = xAxis.ScaleDisplay.ValueToSpanPixels(plotDataPointBubble.Radius);
                 left   = xAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.X) - num;
                 right  = xAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.X) + num;
                 top    = yAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.Y) - num;
                 bottom = yAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.Y) + num;
             }
             else
             {
                 left   = xAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.X - plotDataPointBubble.Radius);
                 right  = xAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.X + plotDataPointBubble.Radius);
                 top    = yAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.Y - plotDataPointBubble.Radius);
                 bottom = yAxis.ScaleDisplay.ValueToPixels(plotDataPointBubble.Y + plotDataPointBubble.Radius);
             }
             Rectangle rectangle = iRectangle.FromLTRB(base.XYSwapped, left, top, right, bottom);
             if (base.BoundsClip.IntersectsWith(rectangle))
             {
                 this.I_Fill.DrawEllipse(p, rectangle);
             }
         }
     }
 }