Class ChartPositionConverter

java.lang.Object
com._1c.g5.v8.dt.chart.converter.ChartPositionConverter

public final class ChartPositionConverter extends Object
Converts canvas coordinates of chart images into model ones and back.
  • Method Details

    • canvasToChartModelRectangle

      public static DoubleRect canvasToChartModelRectangle(org.eclipse.swt.graphics.Rectangle canvasRect, int canvasWidth, int canvasHeight)
      Converts canvas rectangle into model coordinates of a chart image.
      Parameters:
      canvasRect - the canvas rectangle to convert
      canvasWidth - the width of the whole canvas
      canvasHeight - the height of the whole canvas
      Returns:
      the chart model's rectangle, never null
    • chartModelToCanvasRectangle

      public static org.eclipse.swt.graphics.Rectangle chartModelToCanvasRectangle(DoubleRect modelRect, int canvasWidth, int canvasHeight)
      Converts chart model's rectangle into canvas coordinates of a chart image.
      Parameters:
      modelRect - the chart model's rectangle to convert
      canvasWidth - the width of the whole canvas
      canvasHeight - the height of the whole canvas
      Returns:
      the canvas rectangle, never null