I have a combined XYPlot with three sub-charts. Each sub-chart as a single point called DataPoint. Is it possible for each plot to have the same color line and to share the legend entry .. instead of having three legend entries called DataPoint?
Thanks,
-- Casey
CombinedChart with Same Legend
Re: CombinedChart with Same Legend
Why do you need to recreate the DataPoint 3 times. Is it not possible to have another sub-plot just with this DataPoint on it?
The same color line can be achieved by using a renderer and specifying your own set of colors (each the same), but I don't know how to apply a single legend for 3 different lines. Hope this helps, LEE
The same color line can be achieved by using a renderer and specifying your own set of colors (each the same), but I don't know how to apply a single legend for 3 different lines. Hope this helps, LEE
Re: CombinedChart with Same Legend
The three data points are from three different sources, just the same name.
For example. I need to track kW used at three different locations. Each location with a different sub-chart. I want the legend to just show one kW.
Thanks for the help!
-- Casey
For example. I need to track kW used at three different locations. Each location with a different sub-chart. I want the legend to just show one kW.
Thanks for the help!
-- Casey
CombinedXYPlot series colors
I have been using the CombinedXYPlot displaying multiple plots with each another color from the Paint set (default JFreeChart behaviour)
After upgrading to 0.9.4, each chart starts with the first color from the set. Why doesn't it cycle through the default paint set anymore??
After upgrading to 0.9.4, each chart starts with the first color from the set. Why doesn't it cycle through the default paint set anymore??
Re: CombinedXYPlot series colors
R. Teekema wrote:
> I have been using the CombinedXYPlot displaying multiple
> plots with each another color from the Paint set (default
> JFreeChart behaviour)
> After upgrading to 0.9.4, each chart starts with the first
> color from the set. Why doesn't it cycle through the default
> paint set anymore??
Each subplot now uses it's own color set, rather than referring up to the parent plot. This makes a lot of things much simpler in the code, but it does mean that you have to manually set unique colors for each subplot, because they all start off with the same default color set. I will try to find a way to fix this...
Regards,
DG
> I have been using the CombinedXYPlot displaying multiple
> plots with each another color from the Paint set (default
> JFreeChart behaviour)
> After upgrading to 0.9.4, each chart starts with the first
> color from the set. Why doesn't it cycle through the default
> paint set anymore??
Each subplot now uses it's own color set, rather than referring up to the parent plot. This makes a lot of things much simpler in the code, but it does mean that you have to manually set unique colors for each subplot, because they all start off with the same default color set. I will try to find a way to fix this...
Regards,
DG
Re: CombinedChart with Same Legend
Casey Rodgers wrote:
> I have a combined XYPlot with three sub-charts. Each
> sub-chart as a single point called DataPoint. Is it
> possible for each plot to have the same color line and to
> share the legend entry .. instead of having three legend
> entries called DataPoint?
You could subclass CombinedXYPlot and override the getLegendItems(...) method. By default, it collects all the legend items from all of the subplots, but you could easily change this.
Regards,
DG
> I have a combined XYPlot with three sub-charts. Each
> sub-chart as a single point called DataPoint. Is it
> possible for each plot to have the same color line and to
> share the legend entry .. instead of having three legend
> entries called DataPoint?
You could subclass CombinedXYPlot and override the getLegendItems(...) method. By default, it collects all the legend items from all of the subplots, but you could easily change this.
Regards,
DG
Re: CombinedChart with Same Legend
I'm trying to overwrite the getLegendItem() function ... how can I get access to all the subplots within that CombinedXYPlot. Shouldn't there be a sort of "getSubplots()" function in the CombinedXYPlot ? ..
Regards ,
Bjarni
Regards ,
Bjarni