Class 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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCubicLineChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness) Builds a cubic line chart. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThe graphical representation of a path.protected voiddrawPoints(Canvas canvas, Paint paint, List<Float> pointsList, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex) Draws the series points.Returns the chart type identifier.Methods inherited from class LineChart
clickableAreasForPoints, drawLegendShape, drawSeries, getLegendShapeWidth, getPointsChart, isRenderPoints, setDatasetRendererMethods inherited from class XYChart
draw, drawChartValuesText, drawSeries, drawText, drawXLabels, drawXTextLabels, drawYLabels, getCalcRange, getDataset, getDefaultMinimum, getRenderer, getScreenR, getSeriesAndPointForScreenCoordinate, getXLabels, getYLabels, isRenderNullValues, setCalcRange, setScreenR, toRealPoint, toRealPoint, toScreenPoint, toScreenPointMethods inherited from class AbstractChart
calculateDrawPoints, drawBackground, drawLabel, drawLegend, drawPath, drawString, getExceed, getLabel, getLegendSize, isNullValue, isVertical
-
Field Details
-
TYPE
-
-
Constructor Details
-
CubicLineChart
public CubicLineChart() -
CubicLineChart
public CubicLineChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness) Builds a cubic line chart.
Parameters
-
dataset: the dataset -
renderer: the renderer -
smoothness: @param smoothness 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
Description copied from class:AbstractChartThe graphical representation of a path.
Parameters
-
canvas: the canvas to paint to -
points: the points that are contained in the path to paint -
paint: the paint to be used for painting -
circular: if the path ends with the start point
- Overrides:
drawPathin classAbstractChart
-
-
drawPoints
protected void drawPoints(Canvas canvas, Paint paint, List<Float> pointsList, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex) Draws the series points.
Parameters
-
canvas: the canvas -
paint: the paint object -
pointsList: the points to be rendered -
seriesRenderer: the series renderer -
yAxisValue: the y axis value in pixels -
seriesIndex: the series index -
startIndex: the start index of the rendering points
- Overrides:
drawPointsin classXYChart
-
-
getChartType
Returns the chart type identifier.
Returns
the chart type
- Overrides:
getChartTypein classLineChart
-