Package org.jfree.data.xy

Examples of org.jfree.data.xy.XYDataset


     * @return chart
     */
    private JFreeChart generateSparklineAreaChart(String key, String color, Statistic [] stats, long startTime, long endTime, int dataPoints) {
        Color backgroundColor = getBackgroundColor();

        XYDataset dataset = populateData(key, stats, startTime, endTime, dataPoints);

        JFreeChart chart = ChartFactory.createXYAreaChart(
                null, // chart title
                null, // xaxis label
                null, // yaxis label
View Full Code Here


                }
            }
            series.addOrUpdate(ms_read, poweredValue);
        }

        XYDataset xyDataset = new TimeSeriesCollection(series);

        chart = ChartFactory.createTimeSeriesChart("Chart",
                "TIME", "VALUE",
                xyDataset,
                true, // legend
View Full Code Here

  /**
   *
   */
  private void addChart() {
    series = new XYSeries("Temperature");
    XYDataset xyDataset=new XYSeriesCollection(series);   
    JFreeChart chart=ChartFactory.createTimeSeriesChart("History","Time","Temperature",
        xyDataset,false,false,false);
    //chart.getXYPlot()
    jPanelChart=new ChartPanel(chart);
    jPanelChart.setOpaque(false);
View Full Code Here

        setContentPane(chartPanel);
    }

    private static JFreeChart createChart() {
        int giorniScala = 365;
        XYDataset dataset1 = createDataset("Rss", 100.0, new Day(), giorniScala);

        JFreeChart chart = ChartFactory.createTimeSeriesChart("Sinossi", "Mesi", "Scala Rss", dataset1, true, true, false);
        chart.setBackgroundPaint(Color.white);

        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setOrientation(PlotOrientation.VERTICAL);
        plot.setBackgroundPaint(Color.white);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);

        // plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
        // plot.getRangeAxis().setFixedDimension(15.0);

        XYItemRenderer renderer = plot.getRenderer();
        renderer.setSeriesPaint(0, Color.green);

        // Mail
        NumberAxis axis2 = new NumberAxis("Scala Mail");
        axis2.setFixedDimension(10.0);
        axis2.setAutoRangeIncludesZero(false);
        axis2.setLabelPaint(Color.red);
        axis2.setTickLabelPaint(Color.red);
        plot.setRangeAxis(1, axis2);
        plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_LEFT);

        XYDataset dataset2 = createDataset("Mail", 1000.0, new Day(), 170);
        plot.setDataset(1, dataset2);
        plot.mapDatasetToRangeAxis(1, 1);

        XYItemRenderer renderer2 = new StandardXYItemRenderer();
        renderer2.setSeriesPaint(0, Color.red);
        plot.setRenderer(1, renderer2);

        // Sms
        NumberAxis axis3 = new NumberAxis("Scala Sms");
        axis3.setLabelPaint(Color.blue);
        axis3.setTickLabelPaint(Color.blue);
        plot.setRangeAxis(2, axis3);

        XYDataset dataset3 = createDataset("Sms", 10000.0, new Day(), 170);
        plot.setDataset(2, dataset3);
        plot.mapDatasetToRangeAxis(2, 2);

        XYItemRenderer renderer3 = new StandardXYItemRenderer();
        renderer3.setSeriesPaint(0, Color.blue);
View Full Code Here

        return storicoDao.getStorico(criteria);
    }

    public StoricoServiceImpl() {
        super("Time Series Demo 8");
        XYDataset xydataset = createDataset();
        JFreeChart jfreechart = createChart(xydataset);
        ChartPanel chartpanel = new ChartPanel(jfreechart);
        chartpanel.setPreferredSize(new Dimension(500, 270));
        chartpanel.setMouseZoomable(true, false);
        setContentPane(chartpanel);
View Full Code Here

    int numberOfPoints = values.length;
    double xx = min;
    double step = (max - min) / ((double) numberOfPoints);
    for( int i = 0; i < numberOfPoints; i++, xx += step )
      series.add(xx, values[i]);
    XYDataset xyDataset = new XYSeriesCollection(series);

    // Create plot and show it
    JFreeChart chart = ChartFactory.createXYLineChart(title, "x", "Membership", xyDataset, PlotOrientation.VERTICAL, false, true, false);

    if( showIt ) PlotWindow.showIt(title, chart);
View Full Code Here

    for( Iterator it = iterator(); it.hasNext(); ) {
      double xx = (Double) it.next();
      double yy = getDiscreteValue(xx);
      series.add(xx, yy);
    }
    XYDataset xyDataset = new XYSeriesCollection(series);

    // Create plot and show it
    JFreeChart chart = ChartFactory.createScatterPlot(title, "x", "Membership", xyDataset, PlotOrientation.VERTICAL, false, true, false);
    if( showIt ) PlotWindow.showIt(title, chart);
View Full Code Here

    // Evaluate membership function and add points to dataset
    XYSeries series = new XYSeries(title);
    for( int i = 0; i < numberOfPoints; i++ )
      series.add(valueX(i), membership(i));
    XYDataset xyDataset = new XYSeriesCollection(series);

    // Create plot and show it
    JFreeChart chart = ChartFactory.createScatterPlot(title, "x", "Membership", xyDataset, PlotOrientation.VERTICAL, false, true, false);
    if( showIt ) PlotWindow.showIt(title, chart);
View Full Code Here

    double xx = universeMin;
    double step = (universeMax - universeMin) / ((double) numberOfPoints);
    for( int i = 0; i < numberOfPoints; i++, xx += step ) {
      series.add(xx, membership(xx));
    }
    XYDataset xyDataset = new XYSeriesCollection(series);

    // Create plot and show it
    JFreeChart chart = ChartFactory.createXYLineChart(title, "x", "Membership", xyDataset, PlotOrientation.VERTICAL, false, true, false );
    if( showIt ) PlotWindow.showIt(title, chart);
   
View Full Code Here

     * Creates a new self-contained panel.
     */
    public MrstkPlotPanelOld(SpectrumArray sp) {
        super(new BorderLayout());
        this.specarr = sp;
        XYDataset dataset = createDataset(specarr, graph_displayed);
        this.chart = createChart(dataset);
        // Disables caching to increase speed of the plot.
        // Useful when doing zoom/pan etc
        chartPanel = new ChartPanel(this.chart, false);
        Box modeBox = Box.createHorizontalBox();
View Full Code Here

TOP

Related Classes of org.jfree.data.xy.XYDataset

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.