Example usage for org.jfree.chart.plot FastXYPlot setDomainGridlinePaint

List of usage examples for org.jfree.chart.plot FastXYPlot setDomainGridlinePaint

Introduction

In this page you can find the example usage for org.jfree.chart.plot FastXYPlot setDomainGridlinePaint.

Prototype

public void setDomainGridlinePaint(Paint paint) 

Source Link

Document

Sets the paint for the grid lines plotted against the domain axis, and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:de.uniol.ui.tsv.ui.LineChartDialog.java

/**
 * @return the resulting chart object/*  www. j  a  va 2  s .  co m*/
 */
protected JFreeChart createChart() {
    JFreeChart chart = ChartFactory.createTimeSeriesChartFast(title, xTitle, yTitle, xy, true, false, false);

    chart.setBackgroundPaint(Color.white);
    chart.getLegend().setBackgroundPaint(new Color(224, 224, 224));

    FastXYPlot plot = (FastXYPlot) chart.getPlot();
    //      plot.setBackgroundPaint(new Color(224, 224, 224));
    plot.setBackgroundPaint(new Color(77, 77, 77));
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    StandardXYItemRendererFast r = new StandardXYItemRendererFast(StandardXYItemRendererFast.LINES, null, null);
    plot.setRenderer(r);

    for (int i : seriesStrokes.keySet()) {
        r.setSeriesStroke(i, seriesStrokes.get(i));
    }
    for (int i : seriesColors.keySet()) {
        r.setSeriesPaint(i, seriesColors.get(i));
    }

    DateAxis da = new DateAxis(xTitle);
    if (useRelativeHourFormat) {
        da.setDateFormatOverride(new RelativeHourFormat());
    }
    da.setLowerMargin(0.03);
    plot.setDomainAxis(da);

    if (minRange != 0.0 && maxRange != 0.0) {
        ValueAxis yaxis = plot.getRangeAxis();
        yaxis.setRange(new Range(minRange, maxRange));
    }

    return chart;
}