List of usage examples for org.jfree.chart.renderer.xy XYStepRendererFast XYStepRendererFast
public XYStepRendererFast(final XYToolTipGenerator toolTipGenerator, final XYURLGenerator urlGenerator)
From source file:de.uniol.ui.tsv.ui.StepChartDialog.java
protected JFreeChart createChart() { JFreeChart chart = ChartFactory.createXYStepChartFast(title, xTitle, yTitle, xy, PlotOrientation.VERTICAL, true, false, false);/*from ww w . j a v a 2s. c o m*/ chart.setBackgroundPaint(Color.white); chart.getLegend().setBackgroundPaint(new Color(224, 224, 224)); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(new Color(224, 224, 224)); plot.setDomainGridlinePaint(Color.lightGray); plot.setRangeGridlinePaint(Color.lightGray); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setRenderer(new XYStepRendererFast(null, null)); XYItemRenderer xyr = plot.getRenderer(); // xyr.setBaseToolTipGenerator(new XYToolTipGenerator() { // public String generateToolTip(XYDataset dataset, int series, // int item) { // return nf.format(dataset.getXValue(series, item)) // + tooltipRangeUnits + ", " // + nf2.format(dataset.getYValue(series, item)) // + tooltipValueUnits; // } // }); for (int i : seriesStrokes.keySet()) { xyr.setSeriesStroke(i, seriesStrokes.get(i)); } for (int i : seriesColors.keySet()) { xyr.setSeriesPaint(i, seriesColors.get(i)); } DateAxis da = new DateAxis(xTitle); if (useRelativeHourFormat) { da.setDateFormatOverride(new RelativeHourFormat()); } da.setLowerMargin(0.03); plot.setDomainAxis(da); ValueAxis yaxis = plot.getRangeAxis(); yaxis.setRange(new Range(minRange, maxRange)); return chart; }