private void setupDateAxis(JFreeChart jchart, Chart chart) { final Plot plot = jchart.getPlot(); final DateAxis axisX = (DateAxis) ((XYPlot)plot).getDomainAxis(); final TimeZone zone = chart.getTimeZone(); if (zone != null) { axisX.setTimeZone(zone); } if (chart.getDateFormat() != null) { axisX.setDateFormatOverride(_dateFormat); } }
private void configureTimeAxis(XYPlot plot) { DateAxis timeAxis = (DateAxis) plot.getDomainAxis(); final Date start = getStartTime(getTimespan()); final Date end = getEndTime(getTimespan()); timeAxis.setRange(start, end); final Locale locale = i18n.getLocale(); IoParameters parameters = getParameters(); String timeformat = parameters.getTimeFormat(); DateFormat requestTimeFormat = new SimpleDateFormat(timeformat, locale); final DateTimeZone timezone = getTimezone(); requestTimeFormat.setTimeZone(timezone.toTimeZone()); timeAxis.setDateFormatOverride(requestTimeFormat); timeAxis.setTimeZone(timezone.toTimeZone()); }
private void configureTimeAxis(XYPlot xyPlot) { DateAxis timeAxis = (DateAxis) xyPlot.getDomainAxis(); timeAxis.setRange(getStartTime(getTimespan()), getEndTime(getTimespan())); String timeformat = "yyyy-MM-dd, HH:mm"; if (getChartStyleDefinitions().containsParameter("timeformat")) { timeformat = getChartStyleDefinitions().getAsString("timeformat"); } DateFormat requestTimeFormat = new SimpleDateFormat(timeformat, i18n.getLocale()); requestTimeFormat.setTimeZone(getTimezone().toTimeZone()); timeAxis.setDateFormatOverride(requestTimeFormat); timeAxis.setTimeZone(getTimezone().toTimeZone()); }
((DateAxis) plot.getDomainAxis()).setTimeZone(pointTimeSeriesCollection.getTimeZone()); plot.setBackgroundPaint(SystemSettingsDao.instance.getColour(SystemSettingsDao.PLOT_BACKGROUND_COLOUR)); Color gridlines = SystemSettingsDao.instance.getColour(SystemSettingsDao.PLOT_GRIDLINE_COLOUR);