Hi,
I'm sure this is simple but I still haven't figured out how things relate to each other yet to do this right. Any help would be greatly appreciated.
I have a TimeSeries and I'd like the curve to change color when it crosses certain limits. Can I specify a 'smart' Stroke that's sensistive to the value it's drawing?
I could have seperate TimeSeries's for each colored bracket and set the color for each of these TimeSeries's and do the comparison's myself and add the values to the right series. Is this the way to do it?
Also, can I add special 'Tick' lines that go across the plot to highlight these limits?
I've bought the developer guide and I couldnt' find any examples like this, it'd be great if anyone can tell me pages/examples I can check out in the developer guide.
Thanks!
How to make the color of the line change as it crosses limit
I use some code like this
Code: Select all
XYItemRenderer renderer = new StandardXYItemRenderer() {
final Stroke thin = new BasicStroke(0.5f);
final Stroke thick = new BasicStroke(1.5f);
public Stroke getItemStroke(int series, int item) {
..
..
return (a > b) ? thick : thin;
}
};
To change the color I use this
Code: Select all
XYItemRenderer renderer = new StandardXYItemRenderer() {
public Paint getItemPaint(int series, int item) {
..
..
return (a > b) ? Color.green : Color.red;
}
};
HI,skunkskunk wrote:To change the color I use this
Code: Select all
XYItemRenderer renderer = new StandardXYItemRenderer() { public Paint getItemPaint(int series, int item) { .. .. return (a > b) ? Color.green : Color.red; } };
Could you tell me more how to use this code?
I realllllllllllllllllly have no idea about it.....

Could you give me some example ?
Thank you