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

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

Introduction

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

Prototype

public XYLineAndShapeRenderer() 

Source Link

Document

Creates a new renderer with default settings.

Usage

From source file:edu.caltechUcla.sselCassel.projects.jMarkets.shared.interfaces.PriceChart.java

public void test() {
    XYSeries testSeries = new XYSeries("Test Series");
    testSeries.add(10, 10);//from   w  w  w.  j a va 2s . c o m
    testSeries.add(20, 20);
    testSeries.add(30, 30);

    XYSeriesCollection collection = new XYSeriesCollection(testSeries);

    NumberAxis yAxis = new NumberAxis("Y Axis");
    NumberAxis xAxis = new NumberAxis("X Axis");

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();

    XYPlot plot = new XYPlot(collection, xAxis, yAxis, renderer);

    JFreeChart chart = new JFreeChart("Price Chart", new Font("Arial", 0, 12), plot, true);
    ChartPanel chartPanel = new ChartPanel(chart, false, false, false, false, false);

    JFrame frame = new JFrame();
    frame.getContentPane().add(chartPanel);
    frame.setVisible(true);
    frame.pack();

}

From source file:edu.caltechUcla.sselCassel.projects.jMarkets.shared.interfaces.PriceChart.java

public JPanel getChartPanel() {
    XYSeriesCollection collection = new XYSeriesCollection();

    Enumeration en = lines.elements();
    while (en.hasMoreElements()) {
        XYSeries series = (XYSeries) en.nextElement();
        collection.addSeries(series);//w  w w  .  j  ava 2s .c  o m
    }

    NumberAxis yAxis = new NumberAxis("Price");
    NumberAxis xAxis = new NumberAxis("Time");

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    XYPlot plot = new XYPlot(collection, xAxis, yAxis, renderer);

    JFreeChart chart = new JFreeChart("Price Chart", new Font("Arial", 0, 12), plot, true);
    ChartPanel chartPanel = new ChartPanel(chart, false, false, false, false, false);

    return chartPanel;
}

From source file:ucar.unidata.idv.control.chart.TimeSeriesChartWrapper.java

/**
 * Utility to make the renderer//from   www  .ja  v  a  2 s . c o m
 *
 * @return The renderer
 */
private XYItemRenderer doMakeRenderer() {
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    //        renderer.setDefaultLinesVisible(true);
    //        renderer.setDefaultShapesVisible(false);
    return renderer;

}