Example usage for org.jfree.chart.renderer XYStepRenderer XYStepRenderer

List of usage examples for org.jfree.chart.renderer XYStepRenderer XYStepRenderer

Introduction

In this page you can find the example usage for org.jfree.chart.renderer XYStepRenderer XYStepRenderer.

Prototype

public XYStepRenderer() 

Source Link

Document

Constructs a new renderer with no tooltip or URL generation.

Usage

From source file:net.sf.statcvs.output.xml.chart.TimeLineChart.java

/**
 * @param filename/*from  w  w w.j av a  2  s. co  m*/
 * @param title
 */
public TimeLineChart(String filename, String title) {
    super(filename, title);

    Paint[] colors = new Paint[1];
    colors[0] = Color.blue;

    tsc = new TimeSeriesCollection();
    //collection.addSeries(createTimeSeries(timeline));

    //String range = timeline.getRangeLabel();
    String domain = I18n.tr("Date");

    setChart(ChartFactory.createTimeSeriesChart(Settings.getProjectName(), I18n.tr("Date"), rangeLabel,
            (XYDataset) tsc, true, true, false));

    //getChart().getPlot().setSeriesPaint(colors);

    XYPlot plot = getChart().getXYPlot();
    ValueAxis axis = plot.getDomainAxis();
    axis.setVerticalTickLabels(true);
    plot.setRenderer(new XYStepRenderer());
}

From source file:de.berlios.statcvs.xml.chart.AbstractTimeSeriesChart.java

/**
 * @param filename//w w  w  . j ava2  s.  c om
 * @param title
 */
public AbstractTimeSeriesChart(ReportSettings settings, String filename, String title, String rangeLabel) {
    super(settings, filename, title);

    tsc = new TimeSeriesCollection();

    setChart(ChartFactory.createTimeSeriesChart(settings.getProjectName(), I18n.tr("Date"), rangeLabel, tsc,
            true, true, false));

    //Paint[] colors = new Paint[1];
    //colors[0] = Color.blue;
    //getChart().getPlot().setSeriesPaint(colors);

    // setup axis
    XYPlot plot = getChart().getXYPlot();
    ValueAxis axis = plot.getDomainAxis();
    axis.setVerticalTickLabels(true);
    plot.setRenderer(new XYStepRenderer());

    // the 4th color is yellow which has almost no contrast to the white 
    // background color, therefore we use a different color
    plot.getRenderer().setSeriesPaint(0, Color.red);
    plot.getRenderer().setSeriesPaint(1, Color.blue);
    plot.getRenderer().setSeriesPaint(2, Color.green);
    plot.getRenderer().setSeriesPaint(3, Color.magenta);
    plot.getRenderer().setSeriesPaint(4, Color.orange);
    plot.getRenderer().setSeriesPaint(5, Color.cyan);
    plot.getRenderer().setSeriesPaint(6, Color.pink);
}