Hi all,
I need clues as to how to do overlaid charts?
Currently I am tracking values for a TimeSeries chart...but I also want
to set thresholds (such as horizontal bars, or something better) to set
zones where those values lie...
For this I would need to overlay charts...
Write now I am simple using JFreeChart chart = ChartFactory.createTimeSeriesChart(xxx)
How do I combine two charts together?
Thanks in advance!
how to do overlaid charts
Re: how to do overlaid charts
And yes forgot to mention the release version I am using...its 0.9.0.
If it does not have feature to do overlay charts, do suggest if there is any other way to get around the problem.
Thanks
If it does not have feature to do overlay charts, do suggest if there is any other way to get around the problem.
Thanks
Re: how to do overlaid charts
David or anyone else qualified,
Please tell me the approach of plotting the above...
Let me reiterate...
On both X and Y axis I need number values...actually on the Y axis, its Time...since I am using Time Series chart to plot a data set. This part I have already dealt with.
Now I want to for my X axis values plot horizontal bar graphs...and these would lie underneath the 'time series' plotted line. So in essence I am mixing time series line with horizontal bar graph.
So how should I go about it?
Thanks
Please tell me the approach of plotting the above...
Let me reiterate...
On both X and Y axis I need number values...actually on the Y axis, its Time...since I am using Time Series chart to plot a data set. This part I have already dealt with.
Now I want to for my X axis values plot horizontal bar graphs...and these would lie underneath the 'time series' plotted line. So in essence I am mixing time series line with horizontal bar graph.
So how should I go about it?
Thanks
Re: how to do overlaid charts
Hi Ansh,
There is a demo application OverlaidPlotDemo that shows the approach. With OverlaidXYPlot you can now add any XYPlot as a subplot, but there is only one type of bar plot available so far (the one that uses VerticalXYBarRenderer as in the demo).
Regards,
DG.
There is a demo application OverlaidPlotDemo that shows the approach. With OverlaidXYPlot you can now add any XYPlot as a subplot, but there is only one type of bar plot available so far (the one that uses VerticalXYBarRenderer as in the demo).
Regards,
DG.
Re: how to do overlaid charts
Hi David,
Yes I already looked at the demo app OverlaidPlotDemo. So let me get this right - what you are saying is that 'there is no way we can plot horizontal bar graphs' with an overlaid XY plot?
SO, there is no such thing as HorizontalXYBarRenderer...? or similar...correct?
I am gonna be in a fix, since the time series chart was working perfect for me, and I already designed the app accordingly...and then the requirement came that I need to have horizontal bar graphs running in the back ground...
Yes I already looked at the demo app OverlaidPlotDemo. So let me get this right - what you are saying is that 'there is no way we can plot horizontal bar graphs' with an overlaid XY plot?
SO, there is no such thing as HorizontalXYBarRenderer...? or similar...correct?
I am gonna be in a fix, since the time series chart was working perfect for me, and I already designed the app accordingly...and then the requirement came that I need to have horizontal bar graphs running in the back ground...
Re: how to do overlaid charts
David,
Essentially what I wanna do, is to have in the background different areas with colored back ground 'zones'. And these zones whether 'red', 'green' or 'yellow' are tied to the X axis mainly and have a lower range and a upper range. So think of it as colored zone areas, say for example sake, on the Y axis - from 0 to 30 (red), 30-60(green), 60-90(yellow).
Also these colored zones should run across parallel to the X axis, on which I have 5 days of data.
Obviouslly I am not tied to Horizontal bar graphs...would AreaXYItemRenderer do the job for me? Since I can have filled areas in it as well? Right?
Essentially what I wanna do, is to have in the background different areas with colored back ground 'zones'. And these zones whether 'red', 'green' or 'yellow' are tied to the X axis mainly and have a lower range and a upper range. So think of it as colored zone areas, say for example sake, on the Y axis - from 0 to 30 (red), 30-60(green), 60-90(yellow).
Also these colored zones should run across parallel to the X axis, on which I have 5 days of data.
Obviouslly I am not tied to Horizontal bar graphs...would AreaXYItemRenderer do the job for me? Since I can have filled areas in it as well? Right?

Re: how to do overlaid charts
I think the PeriodMarkerPlot may do something along these lines. It is a subclass of XYPlot so you can use it in an overlaid chart.
PeriodMarkerPlot was contributed by another developer, and I've never used it, but it would be worth having a look at.
Another solution would be to subclass OverlaidXYPlot and override the drawOutlineAndBackground method to color the ranges the way you want them.
Regards,
DG.
PeriodMarkerPlot was contributed by another developer, and I've never used it, but it would be worth having a look at.
Another solution would be to subclass OverlaidXYPlot and override the drawOutlineAndBackground method to color the ranges the way you want them.
Regards,
DG.