Hello,
Is it possible to have multiple JFreeCharts added to one ChartPanel such that all graphs are visible. I need this because I need to simultaneously graph multiple XYSeriesCollections.
I apologize if I've missed something obvious, but would appreciate a pointer.
Thanks again.
Bflo hotwingz
Multiple charts in one chartpanel?
i have the same problem. i want to display up to four pie charts in one chart panel. they all have independent datasets.
private void createPieChart(Dataset.Parameter p)
{
try
{
PieChart pieChart = new PieChart(p);
setPanel(pieChart.getChartPanel(), frame.getchartPanel());
}
catch (Exception e) ...
}
this is for creating one single pie chart in th chartpanel. the parameters p contains data for creating the piedataset. what can i do?
i need help very fast.
private void createPieChart(Dataset.Parameter p)
{
try
{
PieChart pieChart = new PieChart(p);
setPanel(pieChart.getChartPanel(), frame.getchartPanel());
}
catch (Exception e) ...
}
this is for creating one single pie chart in th chartpanel. the parameters p contains data for creating the piedataset. what can i do?
i need help very fast.
Multiple charts in one chartpanel?
Hello again,
Yep, I'm using multiple XYDatasets. Right now I see how to create one XYLIneChart from one (XYDataset)XYSeriesCollection. The chart is then added to one ChartPanel, right? What I need to do is add multiple charts to one ChartPanel and have them all be visible.
Is there such a thing or does it break the semantic of the plot/chartpanel ?
Thanks in advance.
hotwingz
Yep, I'm using multiple XYDatasets. Right now I see how to create one XYLIneChart from one (XYDataset)XYSeriesCollection. The chart is then added to one ChartPanel, right? What I need to do is add multiple charts to one ChartPanel and have them all be visible.
Is there such a thing or does it break the semantic of the plot/chartpanel ?
Thanks in advance.
hotwingz
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It sounds like you should just add multiple ChartPanels to a JPanel, using a standard Swing layout manager (GridLayout?).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Sorry,
I guess I was unclear. All the graphs have to be in one plot. Or, if you think in layers, they should all overlay each other.
The data are orgainzed as follows:
one peak(looks like a normal distribution curve) = one XYSeries.
series of peaks =one xySeriesCollection.
One experiment = set of peaks in one color.
Imagine wanting to compare experiments. We want to see peaks in different colors but all on the same plot so we can visually compare peak height, peak area, etc.
Thanks for all the help.
hotwingz
I guess I was unclear. All the graphs have to be in one plot. Or, if you think in layers, they should all overlay each other.
The data are orgainzed as follows:
one peak(looks like a normal distribution curve) = one XYSeries.
series of peaks =one xySeriesCollection.
One experiment = set of peaks in one color.
Imagine wanting to compare experiments. We want to see peaks in different colors but all on the same plot so we can visually compare peak height, peak area, etc.
Thanks for all the help.
hotwingz
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
No problem. You can add multiple datasets to a chart, each with its own renderer. For the general approach, check out OverlaidXYPlotDemo1 and OverlaidXYPlotDemo2 in the JFreeChart demo collection.hotwingz wrote:Imagine wanting to compare experiments. We want to see peaks in different colors but all on the same plot so we can visually compare peak height, peak area, etc.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

