public class CombinedXYChart
- Object
- AbstractChart
- XYChart
- CombinedXYChart
Aggregates multiple XYChart implementations into a single plot so
different series can be visualised using different renderers (for example a
line overlaid on top of a bar chart).
Provide the constructor with an XYMultipleSeriesDataset, a matching
XYMultipleSeriesRenderer and an array of
XYCombinedChartDef instances that describe which inner chart type
should render each data series. The combined chart can then be wrapped in a
com.codename1.charts.ChartComponent for display.
Nested types
class CombinedXYChart.XYCombinedChartDef | Definition of a chart inside a combined XY chart. |
Constructors
public CombinedXYChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, CombinedXYChart.XYCombinedChartDef[] chartDefinitions) | Builds a new combined XY chart instance. |
Methods
Inherited fields
Inherited methods
From XYChart
setDatasetRenderer, draw, getXLabels, getYLabels, getScreenR, setScreenR, drawPoints, drawChartValuesText, drawText, drawXLabels, drawYLabels, drawXTextLabels, getRenderer, getDataset, getCalcRange, setCalcRange, toRealPoint, toScreenPoint, toRealPoint, toScreenPoint, getSeriesAndPointForScreenCoordinate, isRenderNullValues, isRenderPoints, getDefaultMinimum, getPointsChart
Constructor details
CombinedXYChart
public CombinedXYChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, CombinedXYChart.XYCombinedChartDef[] chartDefinitions)Parameters
datasetXYMultipleSeriesDataset- the multiple series dataset
rendererXYMultipleSeriesRenderer- the multiple series renderer
chartDefinitionsCombinedXYChart.XYCombinedChartDef[]- the XY chart definitions
Method details
drawSeries
public void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex)Parameters
canvasCanvas- the canvas to paint to
paintPaint- the paint to be used for drawing
pointsList<Float>- the array of points to be used for drawing the series
seriesRendererXYSeriesRenderer- the series renderer
yAxisValuefloat- the minimum value of the y axis
seriesIndexint- the index of the series currently being drawn
startIndexint- the start index of the rendering points
clickableAreasForPoints
protected ClickableArea[] clickableAreasForPoints(List<Float> points, List<Double> values, float yAxisValue, int seriesIndex, int startIndex)Parameters
pointsList<Float>- the array of points
valuesList<Double>- the array of values of each point
yAxisValuefloat- the minimum value of the y axis
seriesIndexint- the index of the series to which the points belong
startIndexint- the start index of the rendering points
Returns
drawSeries
protected void drawSeries(XYSeries series, Canvas canvas, Paint paint, List<Float> pointsList, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, XYMultipleSeriesRenderer.Orientation or, int startIndex)Parameters
seriesXYSeries- the series
canvasCanvas- the canvas
paintPaint- the paint object
pointsListList<Float>- the points to be rendered
seriesRendererXYSeriesRenderer- the series renderer
yAxisValuefloat- the y axis value in pixels
seriesIndexint- the series index
orXYMultipleSeriesRenderer.Orientation- the orientation
startIndexint- the start index of the rendering points
getLegendShapeWidth
public int getLegendShapeWidth(int seriesIndex)Parameters
seriesIndexint- the series index
Returns
drawLegendShape
public void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint)Parameters
canvasCanvas- the canvas to paint to
rendererSimpleSeriesRenderer- the series renderer
xfloat- the x value of the point the shape should be drawn at
yfloat- the y value of the point the shape should be drawn at
seriesIndexint- the series index
paintPaint- the paint to be used for drawing
getChartType
public String getChartType()