public double GetNormalizedHeight(PlotYAxis yAxis, double height, MagnitudeStyle heightStyle) { switch (heightStyle) { case MagnitudeStyle.Value: return(height); case MagnitudeStyle.Pixel: return(yAxis.ScaleDisplay.PixelSpanToValue((int)height)); default: return(yAxis.ScaleDisplay.PercentSpanToValue(height)); } }
public double GetNormalizedWidth(PlotXAxis xAxis, double width, MagnitudeStyle widthStyle) { switch (widthStyle) { case MagnitudeStyle.Value: return(width); case MagnitudeStyle.Pixel: return(xAxis.ScaleDisplay.PixelSpanToValue((int)width)); default: return(xAxis.ScaleDisplay.PercentSpanToValue(width)); } }
protected void DrawBlock(PaintArgs p, PlotXAxis xAxis, PlotYAxis yAxis, IPlotFill fill, double centerX, double max, double min, MagnitudeStyle widthStyle, double width) { if (!fill.NotDrawVisible) { double normalizedWidth = base.GetNormalizedWidth(xAxis, width, widthStyle); int num = xAxis.ScaleDisplay.ValueToPixels(centerX - normalizedWidth / 2.0); int num2 = xAxis.ScaleDisplay.ValueToPixels(centerX + normalizedWidth / 2.0); int top = yAxis.ScaleDisplay.ValueToPixels(max); int bottom = yAxis.ScaleDisplay.ValueToPixels(min); if (num == num2) { num2++; } Rectangle r = iRectangle.FromLTRB(base.XYSwapped, num, top, num2, bottom); fill.Draw(p, r); } }