public void Paint(Graphics g, IPlotArea layer, Processed2DPlotData pdata, Processed2DPlotData prevItemData, Processed2DPlotData nextItemData) { // adjust the skip frequency if it was not set appropriate if (_skipFreq <= 0) { _skipFreq = 1; } if (_scatterSymbol is NoSymbol) { return; } var cachedPathData = new CachedPathData(); var cachedBrushData = new CachedBrushData(); PlotRangeList rangeList = pdata.RangeList; PointF[] plotPositions = pdata.PlotPointsInAbsoluteLayerCoordinates; if (!_independentOnShiftingGroupStyles && (0 != _cachedLogicalShiftX || 0 != _cachedLogicalShiftY)) { plotPositions = Processed2DPlotData.GetPlotPointsInAbsoluteLayerCoordinatesWithShift(pdata, layer, _cachedLogicalShiftX, _cachedLogicalShiftY); } // Calculate current scatterSymbol overridden with frame and inset var scatterSymbol = CalculateOverriddenScatterSymbol(); if (_ignoreMissingDataPoints) { // in case we ignore the missing points, all ranges can be plotted // as one range, i.e. continuously // for this, we create the totalRange, which contains all ranges var totalRange = new PlotRangeCompound(rangeList); PaintOneRange(g, layer, plotPositions, totalRange, scatterSymbol, ref cachedPathData, ref cachedBrushData); } else // we not ignore missing points, so plot all ranges separately { for (int i = 0; i < rangeList.Count; i++) { PaintOneRange(g, layer, plotPositions, rangeList[i], scatterSymbol, ref cachedPathData, ref cachedBrushData); } } cachedBrushData.Clear(); cachedPathData.Clear(); }
public RectangleF PaintSymbol(System.Drawing.Graphics g, System.Drawing.RectangleF bounds) { if (_scatterSymbol is NoSymbol) { return(bounds); } var cachedPathData = new CachedPathData(); var cachedBrushData = new CachedBrushData(); var scatterSymbol = CalculateOverriddenScatterSymbol(); CalculatePaths(scatterSymbol, _symbolSize, ref cachedPathData); CalculateBrushes(scatterSymbol, _color, cachedPathData, ref cachedBrushData); GraphicsState gs = g.Save(); g.TranslateTransform(bounds.X + 0.5f * bounds.Width, bounds.Y + 0.5f * bounds.Height); if (null != cachedPathData.InsetPath) { g.FillPath(cachedBrushData.InsetBrush, cachedPathData.InsetPath); } if (null != cachedPathData.FillPath) { g.FillPath(cachedBrushData.FillBrush, cachedPathData.FillPath); } if (null != cachedPathData.FramePath) { g.FillPath(cachedBrushData.FrameBrush, cachedPathData.FramePath); } cachedBrushData.Clear(); cachedPathData.Clear(); g.Restore(gs); if (SymbolSize > bounds.Height) { bounds.Inflate(0, (float)(SymbolSize - bounds.Height)); } return(bounds); }
public RectangleF PaintSymbol(System.Drawing.Graphics g, System.Drawing.RectangleF bounds) { if (_scatterSymbol is NoSymbol) return bounds; var cachedPathData = new CachedPathData(); var cachedBrushData = new CachedBrushData(); var scatterSymbol = CalculateOverriddenScatterSymbol(); CalculatePaths(scatterSymbol, _symbolSize, ref cachedPathData); CalculateBrushes(scatterSymbol, _color, cachedPathData, ref cachedBrushData); GraphicsState gs = g.Save(); g.TranslateTransform(bounds.X + 0.5f * bounds.Width, bounds.Y + 0.5f * bounds.Height); if (null != cachedPathData.InsetPath) g.FillPath(cachedBrushData.InsetBrush, cachedPathData.InsetPath); if (null != cachedPathData.FillPath) g.FillPath(cachedBrushData.FillBrush, cachedPathData.FillPath); if (null != cachedPathData.FramePath) g.FillPath(cachedBrushData.FrameBrush, cachedPathData.FramePath); cachedBrushData.Clear(); cachedPathData.Clear(); g.Restore(gs); if (this.SymbolSize > bounds.Height) bounds.Inflate(0, (float)(this.SymbolSize - bounds.Height)); return bounds; }
public void Paint(Graphics g, IPlotArea layer, Processed2DPlotData pdata, Processed2DPlotData prevItemData, Processed2DPlotData nextItemData) { // adjust the skip frequency if it was not set appropriate if (_skipFreq <= 0) _skipFreq = 1; if (this._scatterSymbol is NoSymbol) return; CachedPathData cachedPathData = new CachedPathData(); CachedBrushData cachedBrushData = new CachedBrushData(); PlotRangeList rangeList = pdata.RangeList; PointF[] plotPositions = pdata.PlotPointsInAbsoluteLayerCoordinates; if (!_independentOnShiftingGroupStyles && (0 != _cachedLogicalShiftX || 0 != _cachedLogicalShiftY)) { plotPositions = Processed2DPlotData.GetPlotPointsInAbsoluteLayerCoordinatesWithShift(pdata, layer, _cachedLogicalShiftX, _cachedLogicalShiftY); } // Calculate current scatterSymbol overridden with frame and inset var scatterSymbol = CalculateOverriddenScatterSymbol(); if (this._ignoreMissingDataPoints) { // in case we ignore the missing points, all ranges can be plotted // as one range, i.e. continuously // for this, we create the totalRange, which contains all ranges var totalRange = new PlotRangeCompound(rangeList); this.PaintOneRange(g, layer, plotPositions, totalRange, scatterSymbol, ref cachedPathData, ref cachedBrushData); } else // we not ignore missing points, so plot all ranges separately { for (int i = 0; i < rangeList.Count; i++) { this.PaintOneRange(g, layer, plotPositions, rangeList[i], scatterSymbol, ref cachedPathData, ref cachedBrushData); } } cachedBrushData.Clear(); cachedPathData.Clear(); }