Class ChartContext
java.lang.Object
com.codename1.ui.chart.ChartContext
Everything a series needs to paint one frame: graphics, the plot rectangle, the axes
and how far the current animation has progressed.
-
Method Summary
Modifier and TypeMethodDescriptiongetChart()The chart being painted.getFont()The label font.The graphics to paint with; translated so the chart's top left is(originX, originY).The shared collision layout: data labels placed through it never overlap each other or the axis labels.intThe chart's x in its parent's paint coordinates (chart.getX()); subtract it from a painted x to get one relative to the chart.intThe chart's y in its parent's paint coordinates (chart.getY()).intPlot height.intPlot width.intgetPlotX()Left of the plot area, in the parent's paint coordinates (the coordinate space ofgetGraphics()), not absolute screen coordinates. A pointer's absolute x converts to this space asabsX - chart.getAbsoluteX() + chart.getX().intgetPlotY()Top of the plot area, in the parent's paint coordinates.floatThe eased animation progress, 0 at the start of a transition and 1 when settled.getTheme()The theme.The value axis a series is measured against.getXAxis()The x axis.booleanTrue when the category (x) axis runs vertically, as in a horizontal bar chart.intmm(float mm) A dimension in pixels from millimetres.floatThe x of a data point in the parent's paint coordinates (seegetPlotX()).floatThe y of a data point in the parent's paint coordinates (seegetPlotY()).floatvaluePosition(Series s, double y) Value to a pixel position along the value axis, for baselines.floatxLength(double dx) The length in pixels ofdxunits along the x axis (a category band, a bar width), measured from the start of the visible range.
-
Method Details
-
getGraphics
The graphics to paint with; translated so the chart's top left is(originX, originY). -
getChart
The chart being painted. -
getTheme
The theme. -
getPlotX
public int getPlotX()Left of the plot area, in the parent's paint coordinates (the coordinate space ofgetGraphics()), not absolute screen coordinates. A pointer's absolute x converts to this space asabsX - chart.getAbsoluteX() + chart.getX(). -
getPlotY
public int getPlotY()Top of the plot area, in the parent's paint coordinates. A pointer's absolute y converts asabsY - chart.getAbsoluteY() + chart.getY(). -
getPlotWidth
public int getPlotWidth()Plot width. -
getPlotHeight
public int getPlotHeight()Plot height. -
getOriginX
public int getOriginX()The chart's x in its parent's paint coordinates (chart.getX()); subtract it from a painted x to get one relative to the chart. -
getOriginY
public int getOriginY()The chart's y in its parent's paint coordinates (chart.getY()). -
getProgress
public float getProgress()The eased animation progress, 0 at the start of a transition and 1 when settled. -
getFont
The label font. -
getLabels
The shared collision layout: data labels placed through it never overlap each other or the axis labels. -
isRotated
public boolean isRotated()True when the category (x) axis runs vertically, as in a horizontal bar chart. -
getXAxis
The x axis. -
getValueAxis
-
screenX
The x of a data point in the parent's paint coordinates (seegetPlotX()). -
screenY
The y of a data point in the parent's paint coordinates (seegetPlotY()). -
xLength
public float xLength(double dx) The length in pixels ofdxunits along the x axis (a category band, a bar width), measured from the start of the visible range. On a linear axis that is the same everywhere; on a non-linear one (aLogAxisx) it is the length at the low end only, so slot widths derived from it stay uniform rather than following each point. -
valuePosition
Value to a pixel position along the value axis, for baselines. -
mm
public int mm(float mm) A dimension in pixels from millimetres.
-