List of usage examples for org.jfree.chart.util RelativeDateFormat setShowZeroDays
public void setShowZeroDays(boolean show)
From source file:org.jfree.chart.demo.RelativeDateFormatDemo2.java
private static JFreeChart createChart(IntervalXYDataset intervalxydataset) { JFreeChart jfreechart = ChartFactory.createXYBarChart("RelativeDateFormat Demo 2", "Date ", true, "Time To Complete", intervalxydataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D)); xyplot.setDomainCrosshairVisible(true); xyplot.setRangeCrosshairVisible(true); XYBarRenderer xybarrenderer = (XYBarRenderer) xyplot.getRenderer(); xybarrenderer.setDrawBarOutline(false); DateAxis dateaxis = new DateAxis(); RelativeDateFormat relativedateformat = new RelativeDateFormat(); relativedateformat.setShowZeroDays(false); relativedateformat.setSecondFormatter(new DecimalFormat("00")); dateaxis.setDateFormatOverride(relativedateformat); xyplot.setRangeAxis(dateaxis);/*from w w w . j a v a 2 s .c o m*/ return jfreechart; }