Package jsynoptic.plugins.jfreechart

Source Code of jsynoptic.plugins.jfreechart.ScatterPlotShape

/* ========================
* JSynoptic : a free Synoptic editor
* ========================
*
* Project Info:  http://jsynoptic.sourceforge.net/index.html
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* (C) Copyright 2001-2003, by :
*     Corporate:
*         Astrium SAS
*         EADS CRC
*     Individual:
*         Nicolas Brodu
*
* $Id: ScatterPlotShape.java,v 1.4 2004/02/02 16:04:40 brodu Exp $
*
* Changes
* -------
* 25-Sep-2003 : Initial public release (NB);
*
*/

package jsynoptic.plugins.jfreechart;

import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.StandardXYItemRenderer;

/**
* @author nbrodu
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class ScatterPlotShape extends ParametricPlotShape {

  static final long serialVersionUID = -8851296600311277389L;

  public ScatterPlotShape(JFreeChart chart) {
    this(chart,0,0,400,300);
  }

  public ScatterPlotShape(JFreeChart chart, int ox, int oy, int width, int height) {
    super(chart, ox, oy, width, height);
    XYPlot plot = (XYPlot)chart.getXYPlot();
    SourceXYDataset dst = (SourceXYDataset)plot.getDataset();
    dst.setNameAccordingToYOnly(false);
    StandardXYItemRenderer renderer =new JSynopticStandardXYItemRenderer(1,StandardXYItemRenderer.SHAPES);
    renderer.setShapesFilled(Boolean.TRUE);
    plot.setRenderer(renderer);
  }
 
}

TOP

Related Classes of jsynoptic.plugins.jfreechart.ScatterPlotShape

TOP
Copyright © 2018 www.massapi.com. 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.