public class CubicLineChart
- Object
- AbstractChart
- XYChart
- LineChart
- CubicLineChart
Draws smooth curves through XY series values using cubic interpolation.
Use this chart when you want to emphasise the trend between points rather
than the raw straight-line segments of LineChart. Supply the
XYMultipleSeriesDataset and XYMultipleSeriesRenderer as usual
and pass an optional smoothness factor to control how tightly the curve
follows the provided data points.
Fields
public static final String TYPE = "Cubic" | The chart type. |
Constructors
public CubicLineChart() | |
public CubicLineChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness) | Builds a cubic line chart. |
Methods
Inherited fields
Inherited methods
From LineChart
setDatasetRenderer, drawSeries, clickableAreasForPoints, getLegendShapeWidth, drawLegendShape, isRenderPoints, getPointsChart
From XYChart
draw, getXLabels, getYLabels, getScreenR, setScreenR, drawSeries, drawChartValuesText, drawText, drawXLabels, drawYLabels, drawXTextLabels, getRenderer, getDataset, getCalcRange, setCalcRange, toRealPoint, toScreenPoint, toRealPoint, toScreenPoint, getSeriesAndPointForScreenCoordinate, isRenderNullValues, getDefaultMinimum
Field details
TYPE
public static final String TYPE = "Cubic"Constructor details
CubicLineChart
public CubicLineChart()CubicLineChart
public CubicLineChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness)Parameters
datasetXYMultipleSeriesDataset- the dataset
rendererXYMultipleSeriesRenderer- the renderer
smoothnessfloat- smoothness determines how smooth the curve should be, range [0->0.5] super smooth, 0.5, means that it might not get close to control points if you have random data // less smooth, (close to 0) means that it will most likely touch all control // points
Method details
drawPath
protected void drawPath(Canvas canvas, List<Float> points, Paint paint, boolean circular)Parameters
canvasCanvas- the canvas to paint to
pointsList<Float>- the points that are contained in the path to paint
paintPaint- the paint to be used for painting
circularboolean- if the path ends with the start point
drawPoints
protected void drawPoints(Canvas canvas, Paint paint, List<Float> pointsList, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex)Parameters
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
startIndexint- the start index of the rendering points
getChartType
public String getChartType()