Class CubicLineChart


public class CubicLineChart extends LineChart

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 Details

  • 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

      protected void drawPath(Canvas canvas, List<Float> points, Paint paint, boolean circular)
      Description copied from class: AbstractChart

      The 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:
      drawPath in class AbstractChart
    • 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:
      drawPoints in class XYChart
    • getChartType

      public String getChartType()

      Returns the chart type identifier.

      Returns

      the chart type

      Overrides:
      getChartType in class LineChart