Class TimeChart


public class TimeChart extends LineChart

Specialised LineChart that formats the X axis as dates or times.

Populate the chart with an XYMultipleSeriesDataset where X values are expressed as milliseconds since the epoch. Configure the desired date format using #setDateFormat(String) or let the chart choose an appropriate format automatically.

  • Field Details

  • Constructor Details

  • Method Details

    • getDateFormat

      public String getDateFormat()

      Returns the date format pattern to be used for formatting the X axis labels.

      Returns

      the date format pattern for the X axis labels

    • setDateFormat

      public void setDateFormat(String format)

      Sets the date format pattern to be used for formatting the X axis labels.

      Parameters
      • format: @param format the date format pattern for the X axis labels. If null, an appropriate default format will be used.
    • drawXLabels

      protected void drawXLabels(List<Double> xLabels, Double[] xTextLabelLocations, Canvas canvas, Paint paint, int left, int top, int bottom, double xPixelsPerUnit, double minX, double maxX)

      The graphical representation of the labels on the X axis.

      Parameters
      • xLabels: the X labels values

      • xTextLabelLocations: the X text label locations

      • canvas: the canvas to paint to

      • paint: the paint to be used for drawing

      • left: the left value of the labels area

      • top: the top value of the labels area

      • bottom: the bottom value of the labels area

      • xPixelsPerUnit: the amount of pixels per one unit in the chart labels

      • minX: the minimum value on the X axis in the chart

      • maxX: the maximum value on the X axis in the chart

      Overrides:
      drawXLabels in class XYChart
    • getChartType

      public String getChartType()

      Returns the chart type identifier.

      Returns

      the chart type

      Overrides:
      getChartType in class LineChart
    • getXLabels

      protected List<Double> getXLabels(double min, double max, int count)
      Overrides:
      getXLabels in class XYChart