Example usage for org.jfree.chart.plot XYPlot setRangePannable

List of usage examples for org.jfree.chart.plot XYPlot setRangePannable

Introduction

In this page you can find the example usage for org.jfree.chart.plot XYPlot setRangePannable.

Prototype

public void setRangePannable(boolean pannable) 

Source Link

Document

Sets the flag that enables or disables panning of the plot along the range axis/axes.

Usage

From source file:org.encog.workbench.tabs.rbf.RadialBasisFunctionsTab.java

public JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createXYLineChart(null, "input (x)", "output (y)", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    XYPlot plot = (XYPlot) chart.getPlot();

    plot.setDomainZeroBaselineVisible(true);
    plot.setRangeZeroBaselineVisible(true);
    plot.setDomainPannable(true);/*from w w w  . j  ava 2s.  c  o  m*/
    plot.setRangePannable(true);
    ValueAxis xAxis = plot.getDomainAxis();
    xAxis.setLowerMargin(0.0);
    xAxis.setUpperMargin(0.0);
    XYLineAndShapeRenderer r = (XYLineAndShapeRenderer) plot.getRenderer();
    r.setDrawSeriesLineAsPath(true);
    r.setSeriesStroke(0, new BasicStroke(1.5f));
    r.setSeriesStroke(1, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 6.0f, 4.0f }, 0.0f));
    r.setSeriesStroke(2, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 6.0f, 4.0f, 3.0f, 3.0f }, 0.0f));
    r.setSeriesStroke(3, new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 4.0f, 4.0f }, 0.0f));

    return chart;
}

From source file:org.gumtree.vis.awt.PlotFactory.java

public static JFreeChart createXYErrorChart(IXYErrorDataset dataset) {

    JFreeChart chart;/*from  w  ww .  j  av  a 2 s  . c  om*/
    String title = null;
    String xTitle = null;
    String yTitle = null;
    if (dataset != null) {
        title = "";
        if (dataset.getTitle() != null) {
            title = dataset.getTitle();
        }
        xTitle = "";
        if (dataset.getXTitle() != null) {
            xTitle += dataset.getXTitle();
        }
        if (dataset.getXUnits() != null) {
            xTitle += " (" + dataset.getXUnits() + ")";
        }
        yTitle = "";
        if (dataset.getYTitle() != null) {
            yTitle += dataset.getYTitle();
        }
        if (dataset.getYUnits() != null) {
            yTitle += " (" + dataset.getYUnits() + ")";
        }
    } else {
        dataset = new XYErrorDataset();
    }
    chart = createXYLineChart(title, xTitle, yTitle, dataset, PlotOrientation.VERTICAL, true, false, true);
    chart.setBackgroundPaint(Color.WHITE);
    final LegendTitle legend = (LegendTitle) chart.getLegend();
    RectangleEdge legendPosition = RectangleEdge.BOTTOM;
    try {
        String legendProperty = "RectangleEdge." + System.getProperty("kuranda1D.legendPosition");
        if (RectangleEdge.BOTTOM.toString().equals(legendProperty))
            legendPosition = RectangleEdge.BOTTOM;
        else if (RectangleEdge.RIGHT.toString().equals(legendProperty))
            legendPosition = RectangleEdge.RIGHT;
        else if (RectangleEdge.LEFT.toString().equals(legendProperty))
            legendPosition = RectangleEdge.LEFT;
        else if (RectangleEdge.TOP.toString().equals(legendProperty))
            legendPosition = RectangleEdge.TOP;
    } catch (Exception e) {
        // TODO: handle exception
    }
    legend.setPosition(legendPosition);
    chart.setBorderVisible(true);
    //      ChartUtilities.applyCurrentTheme(chart);
    //      chartTheme.apply(chart);

    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    //      plot.setRangeZeroBaselineVisible(false);
    //      plot.setDomainZeroBaselineVisible(false);
    ValueAxis rangeAxis = plot.getRangeAxis();
    if (rangeAxis instanceof NumberAxis) {
        ((NumberAxis) rangeAxis).setAutoRangeStickyZero(false);
        ((NumberAxis) rangeAxis).setAutoRangeIncludesZero(false);
    }
    ValueAxis domainAxis = plot.getDomainAxis();
    if (domainAxis instanceof NumberAxis) {
        ((NumberAxis) domainAxis).setAutoRangeStickyZero(false);
        ((NumberAxis) domainAxis).setAutoRangeIncludesZero(false);
    }
    plot.setDomainPannable(true);
    plot.setRangePannable(true);

    plot.setDomainGridlinesVisible(true);
    //        plot.setDomainCrosshairLockedOnData(true);
    //        plot.setDomainCrosshairVisible(true);
    plot.setRangeGridlinesVisible(true);
    //        plot.setRangeCrosshairLockedOnData(true);
    //        plot.setRangeCrosshairVisible(true);

    //      xAxis = plot.getDomainAxis();
    //        yAxis = plot.getRangeAxis();

    plot.setDataset(dataset);
    XYItemRenderer renderer = chart.getXYPlot().getRenderer();
    if (renderer instanceof XYErrorRenderer) {
        //         ((XYLineAndShapeRenderer) renderer).setBaseShapesVisible(true);
        ((XYErrorRenderer) renderer).setBaseShapesFilled(true);
        ((XYErrorRenderer) renderer).setDrawXError(false);
        ((XYErrorRenderer) renderer).setDrawYError(true);
    }

    chart.fireChartChanged();
    return chart;
}

From source file:gov.sandia.umf.platform.ui.jobs.Plot.java

public JFreeChart createChart(final XYDataset dataset) {
    final JFreeChart chart = ChartFactory.createXYLineChart(null, // chart title
            null, // x axis label
            null, // y axis label
            dataset, // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );/*from  w  w w.j  ava  2s.c o m*/

    chart.setBackgroundPaint(Color.white);

    LegendTitle legend = chart.getLegend();
    legend.setVisible(dataset.getSeriesCount() <= 5);

    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setDomainPannable(true);
    plot.setRangePannable(true);
    ValueAxis axis = plot.getRangeAxis();
    if (axis instanceof NumberAxis)
        ((NumberAxis) axis).setAutoRangeIncludesZero(false);

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    for (int i = 0; i < dataset.getSeriesCount(); i++)
        renderer.setSeriesShapesVisible(i, false);
    plot.setRenderer(renderer);

    return chart;
}

From source file:gov.sandia.umf.platform.ui.jobs.Raster.java

public JFreeChart createChart(final XYDataset dataset) {
    final JFreeChart chart = ChartFactory.createScatterPlot(null, // chart title
            null, // x axis label
            null, // y axis label
            dataset, // data
            PlotOrientation.VERTICAL, false, // include legend
            true, // tooltips
            false // urls
    );//from  w ww .  j a v  a  2  s .  c om

    chart.setBackgroundPaint(Color.white);

    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.lightGray);
    plot.setDomainPannable(true);
    plot.setRangePannable(true);

    plot.setRenderer(new XYDotRenderer() {
        public void drawItem(java.awt.Graphics2D g2, XYItemRendererState state,
                java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis,
                ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState,
                int pass) {
            // Copied from org.jfree.chart.renderer.xy.XYDotRenderer.java and modified.
            // This would only need to be a couple of lines if they authors of jfreechart had not made dotWidth and dotHeight private members.
            // Yet another example of textbook OO programming gone awry. (Can anyone hear me scream?)

            if (!getItemVisible(series, item))
                return;

            int dotWidth = 1;

            double rasterLines = rangeAxis.getRange().getLength();
            int pixels = g2.getClipBounds().height;
            double height = pixels / rasterLines;
            if (height > 10)
                height -= 2;
            else if (height > 2)
                height -= 1;
            int dotHeight = (int) Math.min(20, Math.max(1, Math.floor(height)));

            double x = dataset.getXValue(series, item);
            double y = dataset.getYValue(series, item);
            if (Double.isNaN(y))
                return;
            double adjx = (dotWidth - 1) / 2.0;
            double adjy = (dotHeight - 1) / 2.0;

            RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
            RectangleEdge yAxisLocation = plot.getRangeAxisEdge();
            double transX = domainAxis.valueToJava2D(x, dataArea, xAxisLocation) - adjx;
            double transY = rangeAxis.valueToJava2D(y, dataArea, yAxisLocation) - adjy;

            g2.setPaint(Color.black);
            PlotOrientation orientation = plot.getOrientation();
            if (orientation == PlotOrientation.HORIZONTAL)
                g2.fillRect((int) transY, (int) transX, dotHeight, dotWidth);
            else
                g2.fillRect((int) transX, (int) transY, dotWidth, dotHeight);

            int domainAxisIndex = plot.getDomainAxisIndex(domainAxis);
            int rangeAxisIndex = plot.getRangeAxisIndex(rangeAxis);
            updateCrosshairValues(crosshairState, x, y, domainAxisIndex, rangeAxisIndex, transX, transY,
                    orientation);
        }
    });

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // Integer units only

    return chart;
}

From source file:com.seagate.kinetic.monitor.view.KineticSpecifiedNodeView.java

private void createStatChart() {
    TimeSeriesCollection putOpsTsc = new TimeSeriesCollection(putOpsTs);
    TimeSeriesCollection putTrgTsc = new TimeSeriesCollection(putTrgTs);
    TimeSeriesCollection getOpsTsc = new TimeSeriesCollection(getOpsTs);
    TimeSeriesCollection getTrgTsc = new TimeSeriesCollection(getTrgTs);
    TimeSeriesCollection deleteOpsTsc = new TimeSeriesCollection(deleteOpsTs);
    TimeSeriesCollection deleteTrgTsc = new TimeSeriesCollection(deleteTrgTs);

    statChart = ChartFactory.createTimeSeriesChart("", "Time", "put kvop/s", putOpsTsc, true, true, false);
    XYPlot xyplot = (XYPlot) statChart.getPlot();
    xyplot.setOrientation(PlotOrientation.VERTICAL);
    xyplot.setDomainPannable(true);//from   w w  w . j a  va 2s  . c  om
    xyplot.setRangePannable(true);

    ValueAxis yAxis = xyplot.getDomainAxis();
    yAxis.setAutoRange(true);
    yAxis.setFixedAutoRange(60000.0);

    NumberAxis numberaxis1 = new NumberAxis("get kvop/s");
    xyplot.setRangeAxis(1, numberaxis1);
    xyplot.setDataset(1, getOpsTsc);
    xyplot.mapDatasetToRangeAxis(1, 1);
    StandardXYItemRenderer standardxyitemrenderer1 = new StandardXYItemRenderer();
    xyplot.setRenderer(1, standardxyitemrenderer1);

    NumberAxis numberaxis2 = new NumberAxis("delete kvop/s");
    numberaxis2.setAutoRangeIncludesZero(false);
    xyplot.setRangeAxis(2, numberaxis2);
    xyplot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_LEFT);
    xyplot.setDataset(2, deleteOpsTsc);
    xyplot.mapDatasetToRangeAxis(2, 2);
    StandardXYItemRenderer standardxyitemrenderer2 = new StandardXYItemRenderer();
    xyplot.setRenderer(2, standardxyitemrenderer2);

    NumberAxis numberaxis3 = new NumberAxis("put MB/s");
    xyplot.setRangeAxis(3, numberaxis3);
    xyplot.setDataset(3, putTrgTsc);
    xyplot.mapDatasetToRangeAxis(3, 3);
    StandardXYItemRenderer standardxyitemrenderer3 = new StandardXYItemRenderer();
    xyplot.setRenderer(3, standardxyitemrenderer3);

    NumberAxis numberaxis4 = new NumberAxis("get MB/s");
    numberaxis4.setAutoRangeIncludesZero(false);
    xyplot.setRangeAxis(4, numberaxis4);
    xyplot.setRangeAxisLocation(2, AxisLocation.BOTTOM_OR_LEFT);
    xyplot.setDataset(4, getTrgTsc);
    xyplot.mapDatasetToRangeAxis(4, 4);
    StandardXYItemRenderer standardxyitemrenderer4 = new StandardXYItemRenderer();
    xyplot.setRenderer(4, standardxyitemrenderer4);

    NumberAxis numberaxis5 = new NumberAxis("delete MB/s");
    xyplot.setRangeAxis(5, numberaxis5);
    xyplot.setDataset(5, deleteTrgTsc);
    xyplot.mapDatasetToRangeAxis(5, 5);
    StandardXYItemRenderer standardxyitemrenderer5 = new StandardXYItemRenderer();
    xyplot.setRenderer(5, standardxyitemrenderer5);

    ChartUtilities.applyCurrentTheme(statChart);
    xyplot.getRenderer().setSeriesPaint(0, Color.black);
    standardxyitemrenderer1.setSeriesPaint(0, Color.red);
    numberaxis1.setLabelPaint(Color.red);
    numberaxis1.setTickLabelPaint(Color.red);
    standardxyitemrenderer2.setSeriesPaint(0, Color.green);
    numberaxis2.setLabelPaint(Color.green);
    numberaxis2.setTickLabelPaint(Color.green);
    standardxyitemrenderer3.setSeriesPaint(0, Color.orange);
    numberaxis3.setLabelPaint(Color.orange);
    numberaxis3.setTickLabelPaint(Color.orange);
    standardxyitemrenderer4.setSeriesPaint(0, Color.blue);
    numberaxis4.setLabelPaint(Color.blue);
    numberaxis4.setTickLabelPaint(Color.blue);
    standardxyitemrenderer5.setSeriesPaint(0, Color.cyan);
    numberaxis5.setLabelPaint(Color.cyan);
    numberaxis5.setTickLabelPaint(Color.cyan);

    final JPanel main = new JPanel(new BorderLayout());
    final JPanel optionsPanel = new JPanel();

    String[] options = { SYSTEM_TOTAL_IOPS_AND_THROUGHPUT_STATISTICS };
    this.orientationComboBox = new JComboBox<String>(options);
    this.orientationComboBox.setSize(600, 50);
    this.orientationComboBox.addActionListener(this);
    optionsPanel.add(this.orientationComboBox);

    chartPanel = new ChartPanel(statChart);
    chartPanel.setMouseWheelEnabled(false);
    chartPanel.setPreferredSize(new Dimension(900, 450));
    chartPanel.setDomainZoomable(true);
    chartPanel.setRangeZoomable(true);

    main.add(optionsPanel, BorderLayout.NORTH);
    main.add(this.chartPanel);
    setContentPane(main);
}

From source file:net.sf.maltcms.chromaui.chromatogram2Dviewer.ui.Chromatogram2DViewTopComponent.java

private XYPlot createPlot(IChromatogramDescriptor chromatogram, ADataset2D<IChromatogram2D, IScan2D> ds,
        PaintScale ps) {//from w  w w.ja v a 2 s. co m
    XYNoBlockRenderer xybr = new XYNoBlockRenderer();
    xybr.setPaintScale(ps);
    try {
        double modulationTime = chromatogram.getChromatogram().getParent().getChild("modulation_time")
                .getArray().getDouble(0);
        double scanRate = chromatogram.getChromatogram().getParent().getChild("scan_rate").getArray()
                .getDouble(0);
        xybr.setDefaultEntityRadius(10);//Math.max(1, (int)(modulationTime / scanRate)));
        xybr.setEntityThreshold(ds.getMinZ());
        xybr.setBlockWidth(modulationTime);
        xybr.setBlockAnchor(RectangleAnchor.CENTER);
        double spm = modulationTime * scanRate;
        double scanDuration = modulationTime / spm;
        xybr.setBlockHeight(scanDuration);
    } catch (ResourceNotAvailableException rnae) {
    }
    RTUnit rtUnit = RTUnit.SECONDS;
    xybr.setToolTipGenerator(
            new StandardXYZToolTipGenerator("{0}: @({1}, {2}) = {3}", DecimalFormat.getNumberInstance(),
                    DecimalFormat.getNumberInstance(), DecimalFormat.getNumberInstance()));
    NumberAxis rt1 = new NumberAxis("RT1 [" + rtUnit.name().toLowerCase() + "]");
    NumberAxis rt2 = new NumberAxis("RT2 [" + rtUnit.name().toLowerCase() + "]");
    rt1.setAutoRange(false);
    rt1.setLowerBound(ds.getMinX());
    rt1.setUpperBound(ds.getMaxX());
    rt1.setRangeWithMargins(ds.getMinX(), ds.getMaxX());
    rt2.setFixedAutoRange(ds.getMaxX() - ds.getMinX());
    rt2.setAutoRange(false);
    rt2.setLowerBound(ds.getMinY());
    rt2.setUpperBound(ds.getMaxY());
    rt2.setFixedAutoRange(ds.getMaxY() - ds.getMinY());
    rt2.setRangeWithMargins(ds.getMinY(), ds.getMaxY());
    XYPlot heatmapPlot = new XYPlot(ds, rt1, rt2, xybr);
    heatmapPlot.setDomainPannable(true);
    heatmapPlot.setRangePannable(true);
    return heatmapPlot;
}

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.Chromatogram1DHeatmapViewTopComponent.java

private XYPlot createPlot(ADataset2D<IChromatogram1D, IScan> ds) {
    XYBlockRenderer xybr = new XYBlockRenderer();
    IPaintScaleProvider ips = Lookup.getDefault().lookup(IPaintScaleProvider.class);
    ips.setMin(ds.getMinZ());//from   ww  w . java  2s.  c o m
    ips.setMax(ds.getMaxZ());
    PaintScale ps = ips.getPaintScales().get(0);
    xybr.setPaintScale(ps);
    xybr.setDefaultEntityRadius(5);
    xybr.setBlockWidth(0.1);
    xybr.setBlockAnchor(RectangleAnchor.CENTER);
    xybr.setBlockHeight(1.0);
    RTUnit rtUnit = RTUnit.SECONDS;
    xybr.setToolTipGenerator(
            new StandardXYZToolTipGenerator("{0}: @({1}, {2}) = {3}", DecimalFormat.getNumberInstance(),
                    DecimalFormat.getNumberInstance(), DecimalFormat.getNumberInstance()));
    NumberAxis rt1 = new NumberAxis("Retention Time [" + rtUnit.name().toLowerCase() + "]");
    NumberAxis rt2 = new NumberAxis("M/Z");
    rt1.setAutoRange(false);
    rt1.setLowerBound(ds.getMinX());
    rt1.setUpperBound(ds.getMaxX());
    rt1.setRangeWithMargins(ds.getMinX(), ds.getMaxX());
    rt2.setFixedAutoRange(ds.getMaxX() - ds.getMinX());
    rt2.setAutoRange(false);
    rt2.setLowerBound(ds.getMinY());
    rt2.setUpperBound(ds.getMaxY());
    rt2.setFixedAutoRange(ds.getMaxY() - ds.getMinY());
    rt2.setRangeWithMargins(ds.getMinY(), ds.getMaxY());
    XYPlot heatmapPlot = new XYPlot(ds, rt1, rt2, xybr);
    heatmapPlot.setDomainPannable(true);
    heatmapPlot.setRangePannable(true);
    return heatmapPlot;
}

From source file:com.att.aro.ui.view.diagnostictab.plot.SpeedThrottlePlot.java

/**
 * @param plot//from w ww.  j  a v  a 2  s.c  o  m
 * @param seriesDL
 * @param seriesUP
 */
private void setDataPlot(XYPlot plot, XYSeries seriesDL, XYSeries seriesUP) {
    serCollection.addSeries(seriesDL);
    serCollection.addSeries(seriesUP);

    XYStepRenderer renderer = new XYStepRenderer();

    LogAxis rangeAxis = new LogAxis(); // new API 
    rangeAxis.setAutoRange(true);
    rangeAxis.setVisible(false);
    plot.setRangeAxis(rangeAxis);
    plot.setRangePannable(true);
    plot.setRangeCrosshairVisible(true);

    renderer = (XYStepRenderer) plot.getRenderer();
    renderer.setBaseShapesVisible(true);
    renderer.setSeriesStroke(0, new BasicStroke(1.0f));
    renderer.setSeriesStroke(1, new BasicStroke(2.5f));
    renderer.setSeriesPaint(0, Color.blue);
    renderer.setSeriesPaint(1, Color.red);
    renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
    renderer.setDefaultEntityRadius(6);

    renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
        @Override
        public String generateToolTip(XYDataset dataset, int series, int item) {
            StringBuffer displayInfo = new StringBuffer();
            java.lang.Number tempx = dataset.getX(series, item);
            java.lang.Number tempy = dataset.getY(series, item);
            // series 0 -> downstream , stries 1 -> upstream
            String streamInfo = "";
            if (series == 0) {
                streamInfo = ResourceBundleHelper.getMessageString("dlog.collector.option.attenuator.downlink");
            } else {
                streamInfo = ResourceBundleHelper.getMessageString("dlog.collector.option.attenuator.uplink");
            }
            return displayInfo.append("Time: " + tempx + " , " + streamInfo + " : " + tempy + " kbps")
                    .toString();
        }
    });
    plot.setRenderer(renderer);
    plot.setDataset(serCollection);

}

From source file:org.gumtree.vis.hist2d.Hist2D.java

private void createChart() {
    createXAxis();/*from ww w  . j  a v  a2  s  .  c  o  m*/
    createYAxis();
    createScaleAxis();

    float min = (float) dataset.getZMin();
    float max = (float) dataset.getZMax();
    PaintScale scale = generateRainbowScale(min, max, ColorScale.Rainbow);
    createRender(scale);

    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinesVisible(false);
    plot.setRangeGridlinePaint(Color.white);
    plot.setDomainPannable(true);
    plot.setRangePannable(true);

    chart = new JFreeChart(dataset.getTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, false);
    //      chart = new JFreeChart(dataset.getTitle(), plot);
    chart.removeLegend();
    chart.setBackgroundPaint(Color.white);

    PaintScale scaleBar = generateRainbowScale(min, max, ColorScale.Rainbow);
    PaintScaleLegend legend = createScaleLegend(scaleBar);
    legend.setSubdivisionCount(ColorScale.DIVISION_COUNT);
    chart.addSubtitle(legend);
    chart.setBorderVisible(true);
    //      ChartUtilities.applyCurrentTheme(chart);
    defaultChartTheme.apply(chart);
    chart.fireChartChanged();
}

From source file:org.gumtree.vis.plot1d.Plot1D.java

private void createChart() {

    String title = null;/* ww w .  j  a v  a  2s .com*/
    String xTitle = null;
    String yTitle = null;
    if (dataset != null) {
        title = dataset.getTitle();
        xTitle = dataset.getXTitle() + (dataset.getXUnits() == null ? "" : " (" + dataset.getXUnits() + ")");
        yTitle = dataset.getYTitle() + (dataset.getYUnits() == null ? "" : " (" + dataset.getYUnits() + ")");
    } else {
        dataset = new XYErrorDataset();
    }
    chart = createXYLineChart(title, xTitle, yTitle, dataset, PlotOrientation.VERTICAL, true, false, true);
    chart.setBackgroundPaint(Color.WHITE);
    final LegendTitle legend = (LegendTitle) chart.getLegend();
    RectangleEdge legendPosition = RectangleEdge.BOTTOM;
    try {
        String legendProperty = "RectangleEdge." + System.getProperty("kuranda1D.legendPosition");
        if (RectangleEdge.BOTTOM.toString().equals(legendProperty))
            legendPosition = RectangleEdge.BOTTOM;
        else if (RectangleEdge.RIGHT.toString().equals(legendProperty))
            legendPosition = RectangleEdge.RIGHT;
        else if (RectangleEdge.LEFT.toString().equals(legendProperty))
            legendPosition = RectangleEdge.LEFT;
        else if (RectangleEdge.TOP.toString().equals(legendProperty))
            legendPosition = RectangleEdge.TOP;
    } catch (Exception e) {
        // TODO: handle exception
    }
    legend.setPosition(legendPosition);
    chart.setBorderVisible(true);
    //      ChartUtilities.applyCurrentTheme(chart);
    //      chartTheme.apply(chart);

    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    plot.setDomainPannable(true);
    plot.setRangePannable(true);

    plot.setDomainGridlinesVisible(true);
    //        plot.setDomainCrosshairLockedOnData(true);
    //        plot.setDomainCrosshairVisible(true);
    plot.setRangeGridlinesVisible(true);
    //        plot.setRangeCrosshairLockedOnData(true);
    //        plot.setRangeCrosshairVisible(true);

    xAxis = plot.getDomainAxis();
    yAxis = plot.getRangeAxis();

    plot.setDataset(dataset);
    XYItemRenderer renderer = chart.getXYPlot().getRenderer();
    if (renderer instanceof XYLineAndShapeRenderer) {
        //         ((XYLineAndShapeRenderer) renderer).setBaseShapesVisible(true);
        ((XYLineAndShapeRenderer) renderer).setBaseShapesFilled(true);
    }
    //      XYErrorRenderer errorRenderer = (XYErrorRenderer) chart.getXYPlot().getRenderer();
    //      errorRenderer.setDrawXError(true);
    //        StandardXYItemRenderer renderer = (StandardXYItemRenderer) plot.getRenderer();
    //        renderer.setPlotLines(true);
    //        renderer.setBaseShapesVisible(true);

    chart.fireChartChanged();
}