Multiple renderes on one chart?
Multiple renderes on one chart?
Is there an easy way to set up multiple renderers on one XYChart?
For example, I have 2 series of time series data but I want one with lines and one with shapes only. I know I can change the XYItemRenderer on the chart itself but this will affect both series.
Thanks for any help
For example, I have 2 series of time series data but I want one with lines and one with shapes only. I know I can change the XYItemRenderer on the chart itself but this will affect both series.
Thanks for any help
Re: Multiple renderes on one chart?
Just a quick note, I realize that this is possible using a combined plot (which is what I am currently using), but I wanted to check if it is doable without the extra overhead of a combined chart.
Thanks again!
Thanks again!
Re: Multiple renderes on one chart?
You have to use the combined plot at the moment. But I have been thinking about setting the plot up to have multiple renderers...so it may be possible in a future version.
Regards,
DG.
Regards,
DG.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Yes it is possible. For an example, take a look at OverlaidXYPlotDemo.java in the src/org/jfree/chart/demo directory.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
I realize the primary and secondary dataset features are there. But what about when I have, for example, 5 series on the same axis and the only thing different about them is what type of renderer they will use. One will be line, one will be bar, one will be shapes, etc. Am I to use multiple secondary axis at different indexes? This doesn't seem very intuitive. I'm confused as to the purpose of the primary and secondary axis. It seems as they they are the same thing with just different indices?
Thanks again,
Stacey
Thanks again,
Stacey
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Each secondary dataset needs to have a secondary renderer, but the primary axis will be used by default...you need to call the mapSecondaryDatasetToRangeAxis(...) to get the dataset to plot against a secondary axis.
But you also seem to be asking whether it would be possible for the primary and secondary axes to be "just axes", with the primary axis being axis[0], and the secondary axes being axis[1], axis[2], ... axis[N]. Originally I steered away from that approach, because I wanted to ensure that developers that are not using secondary axes don't need to specify an axis index (to keep the simple things simple). But thinking about it, that could probably be achieved easily enough by assuming '0' in methods that don't specify an axis index, but also providing similar methods where an axis index can be specified, for example:
It is something I will investigate further when I have some time.
But you also seem to be asking whether it would be possible for the primary and secondary axes to be "just axes", with the primary axis being axis[0], and the secondary axes being axis[1], axis[2], ... axis[N]. Originally I steered away from that approach, because I wanted to ensure that developers that are not using secondary axes don't need to specify an axis index (to keep the simple things simple). But thinking about it, that could probably be achieved easily enough by assuming '0' in methods that don't specify an axis index, but also providing similar methods where an axis index can be specified, for example:
Code: Select all
public void setDomainAxis(ValueAxis axis); // assume index = 0
public void setDomainAxis(int index, ValueAxis axis); // use supplied index
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Any advancements with the previous question?
Thanks!
Stacey
I am still trying to put multiple series, say one line and step-line, on the same axis. Is there a way to map the renderers this way?But what about when I have, for example, 5 series on the same axis and the only thing different about them is what type of renderer they will use. One will be line, one will be bar, one will be shapes, etc
Thanks!
Stacey
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Yes. By default, all datasets will map to the primary range axis. If you want to change that, you can use the mapDatasetToRangeAxis(int, int) method.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program