Logo Search packages:      
Sourcecode: libjfreechart-java version File versions  Download package

static JFreeChart org::jfree::chart::ChartFactory::createXYLineChart ( String  title,
String  xAxisLabel,
String  yAxisLabel,
XYDataset  dataset,
PlotOrientation  orientation,
boolean  legend,
boolean  tooltips,
boolean  urls 
) [inline, static]

Creates a line chart (based on an XYDataset) with default settings.

Parameters:
title the chart title (null permitted).
xAxisLabel a label for the X-axis (null permitted).
yAxisLabel a label for the Y-axis (null permitted).
dataset the dataset for the chart (null permitted).
orientation the plot orientation (horizontal or vertical) (null NOT permitted).
legend a flag specifying whether or not a legend is required.
tooltips configure chart to generate tool tips?
urls configure chart to generate URLs?
Returns:
The chart.

Definition at line 1657 of file ChartFactory.java.

References org::jfree::chart::axis::NumberAxis::setAutoRangeIncludesZero(), org::jfree::chart::renderer::xy::XYItemRenderer::setBaseToolTipGenerator(), org::jfree::chart::plot::XYPlot::setOrientation(), and org::jfree::chart::renderer::xy::XYItemRenderer::setURLGenerator().

                                                             {

        if (orientation == null) {
            throw new IllegalArgumentException("Null 'orientation' argument.");
        }
        NumberAxis xAxis = new NumberAxis(xAxisLabel);
        xAxis.setAutoRangeIncludesZero(false);
        NumberAxis yAxis = new NumberAxis(yAxisLabel);
        XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
        XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
        plot.setOrientation(orientation);
        if (tooltips) {
            renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
        }
        if (urls) {
            renderer.setURLGenerator(new StandardXYURLGenerator());
        }

        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
                plot, legend);

        return chart;

    }


Generated by  Doxygen 1.6.0   Back to index