I have created a TimeSeriesChart which display 2 days worth of data at 30 minute granularity.
I would like the X-Axis to tick interval every 1 hour (which works).
However, because the data spans multiple days you can potentially see repeating times.
Would it be possible that when the time is "00:00" - also display the date ie "13-MAR 00:00".
My current code:
Code: Select all
//Chart Settings
jFreeChart = ChartFactory.createTimeSeriesChart("", "", "Value", dataSet, false, true, false);
jFreeChart.setBackgroundPaint(Color.WHITe);
//Plot Settings
plot = jFreeChart.getXYPlot();
plot.setOrientation(PlotOrientation.VERTICAL);
plot.setBackgroundPaint(Color.BLUE);
plot.setDomainGridlinePaint(Color.BLACK);
plot.setRangeGridlinePaint(Color.BLACK);
plot.setAxisOffset(new RectangleInsets(5, 0, 0, 5));
renderer = new XYLineAndShapeRenderer(true, true);
plot.setRenderer(renderer);
//Date Axis Settings
domainAxis = (DateAxis) plot.getDomainAxis();
plot.setDomainAxis(domainAxis);
domainAxis.setLowerMargin(0.01);
domainAxis.setUpperMargin(0.01);
domainAxis.setTickUnit(new DateTickUnit(DateTickUnitType.HOUR, 1, new SimpleDateFormat("HH:00")), true, true);
domainAxis.setTickMarkPosition(DateTickMarkPosition.START);
https://imgur.com/a/QHnPR2z
Thanks in advance!