scatter plot chart using JChart api(jCharts-0.7.5.jar)
-
- Posts: 25
- Joined: Mon Oct 08, 2007 7:16 am
scatter plot chart using JChart api(jCharts-0.7.5.jar)
i am working on chart generation and i am using JFreechart,JCommon and JChart jar files.I got some examples on scatter plot graphs but in all the examples graph points are joined(line drawn between two points).So i want the scatter plot graph without any joints between the points.....can someone plz send me some sample source code
thanks
mahesh
mahesh
JCharts is not JFreeCharts. It is a different project and maybe you should ask your question regarding JCharts there:
http://sourceforge.net/projects/jcharts
The JFreeChart scatter plot does not connect the points - a scatter plot with connected points could never be a proper scatter plot, right?
Have fun,
said Thomas
http://sourceforge.net/projects/jcharts
The JFreeChart scatter plot does not connect the points - a scatter plot with connected points could never be a proper scatter plot, right?
Have fun,
said Thomas
-
- Posts: 25
- Joined: Mon Oct 08, 2007 7:16 am
-
- Posts: 25
- Joined: Mon Oct 08, 2007 7:16 am
scatter plot chart help
i got some sample code for Scatter Chart .....but in this example, both the X axis and Y axis coordinate values are mandatory to be double values....so my requirement is to display the X axis coordinate values in Time Stamp for format(date format)...Is there any way to do this.....Any help is greatly appreciated........
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;
public class ScatterPlotDemo extends ApplicationFrame {
public ScatterPlotDemo(String title) {
super(title);
XYSeriesCollection dataset = new XYSeriesCollection();
XYSeries series1 = new XYSeries("Series 1");
series1.add(1.0, 4.5);
series1.add(4.4, 3.2);
dataset.addSeries(series1);
XYSeries series2 = new XYSeries("Series 2");
series2.add(3.2, 8.5);
series2.add(4.9, 3.7);
dataset.addSeries(series2);
JFreeChart chart = ChartFactory.createScatterPlot(
"Scatter Plot Demo", // title
"X", "Y", // axis labels
dataset, // dataset
PlotOrientation.VERTICAL,
true, // legend? yes
true, // tooltips? yes
false // URLs? no
);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
}
public static void main(String[] args) {
ScatterPlotDemo demo = new ScatterPlotDemo("Scatter Plot Demo");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);
}
}
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;
public class ScatterPlotDemo extends ApplicationFrame {
public ScatterPlotDemo(String title) {
super(title);
XYSeriesCollection dataset = new XYSeriesCollection();
XYSeries series1 = new XYSeries("Series 1");
series1.add(1.0, 4.5);
series1.add(4.4, 3.2);
dataset.addSeries(series1);
XYSeries series2 = new XYSeries("Series 2");
series2.add(3.2, 8.5);
series2.add(4.9, 3.7);
dataset.addSeries(series2);
JFreeChart chart = ChartFactory.createScatterPlot(
"Scatter Plot Demo", // title
"X", "Y", // axis labels
dataset, // dataset
PlotOrientation.VERTICAL,
true, // legend? yes
true, // tooltips? yes
false // URLs? no
);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
}
public static void main(String[] args) {
ScatterPlotDemo demo = new ScatterPlotDemo("Scatter Plot Demo");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);
}
}
thanks
mahesh
mahesh
-
- Posts: 25
- Joined: Mon Oct 08, 2007 7:16 am
-
- Posts: 25
- Joined: Mon Oct 08, 2007 7:16 am