Class TimeChart
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe number of milliseconds in a day.static final String/** The constant to identify this chart type. -
Constructor Summary
ConstructorsConstructorDescriptionTimeChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer) Builds a new time chart instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawXLabels(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.Returns the chart type identifier.Returns the date format pattern to be used for formatting the X axis labels.getXLabels(double min, double max, int count) voidsetDateFormat(String format) Sets the date format pattern to be used for formatting the X axis labels.Methods inherited from class LineChart
clickableAreasForPoints, drawLegendShape, drawSeries, getLegendShapeWidth, getPointsChart, isRenderPoints, setDatasetRendererMethods inherited from class XYChart
draw, drawChartValuesText, drawPoints, drawSeries, drawText, drawXTextLabels, drawYLabels, getCalcRange, getDataset, getDefaultMinimum, getRenderer, getScreenR, getSeriesAndPointForScreenCoordinate, getYLabels, isRenderNullValues, setCalcRange, setScreenR, toRealPoint, toRealPoint, toScreenPoint, toScreenPointMethods inherited from class AbstractChart
calculateDrawPoints, drawBackground, drawLabel, drawLegend, drawPath, drawPath, drawString, getExceed, getLabel, getLegendSize, isNullValue, isVertical
-
Field Details
-
TYPE
-
DAY
public static final long DAYThe number of milliseconds in a day.- See Also:
-
-
Constructor Details
-
TimeChart
Builds a new time chart instance.
Parameters
-
dataset: the multiple series dataset -
renderer: the multiple series renderer
-
-
-
Method Details
-
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
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:
drawXLabelsin classXYChart
-
-
getChartType
Returns the chart type identifier.
Returns
the chart type
- Overrides:
getChartTypein classLineChart
-
getXLabels
- Overrides:
getXLabelsin classXYChart
-