I have an app which creates a chart of prices over the period of a day. These are prices for power usage and there are always two sets: a set of estimated prices for every hour in the day and a set of actual prices as recorded up to the current our of the day. I'm plotting both series on the same chart by creating an XYSeriesCollection and feeding that into a new XYPlot object. I then set paint colors for each series as well.
I'd like the estimated series to "overlay" the actual series w/out having to create another plot and chart - if this is possible. What happens now is - as its often the case that the estimated and actual price values are the same, the colors of the two series are blended, so my red and blue lines become purple. Instead, I want one of the two series - i.e. the actual price series which will always be a subset on the overall interval - to be the only visible line when the two are traversing the same data points.
hopefully that question makes sense... i fear i'll only confuse it more if i "continue to elabroate."
thanks a bunch.
mx.
Color precedence on multi-series XYPlot
Re: Color precedence on multi-series XYPlot
I understand what you mean.
I need to spend some time (that I don't have right now!) experimenting with changing the AlphaComposite while rendering the charts. You'll see a line like this in XYPlot:
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
this.foregroundAlpha));
My guess is that changing the SRC_OVER to SRC will give you the effect you want, but I need to understand better what is going on before I can say for sure.
Regards,
DG.
I need to spend some time (that I don't have right now!) experimenting with changing the AlphaComposite while rendering the charts. You'll see a line like this in XYPlot:
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
this.foregroundAlpha));
My guess is that changing the SRC_OVER to SRC will give you the effect you want, but I need to understand better what is going on before I can say for sure.
Regards,
DG.