I have drawn 3 trend lines in my graph to specify the threshold values in the time series chart with 3 diffrent colours.
Now i would like to fill colours between these trend lines.
Can any one help me??
Here is the code to draw trend lines.
Date date = DateUtilities.createDate(2002,MonthConstants.JANUARY,1);
Date date1 = DateUtilities.createDate(2002,MonthConstants.NOVEMBER,31);
double x1 = (double)date.getTime();
double x2 = (double)date1.getTime();
double y1 = 95.35;
double y2 = 96.48;
double y3 = 97.50
XYLineAnnotation trendline = new XYLineAnnotation(x1,y1,x2,y1,DOTTED_LINE, Color.green);
XYLineAnnotation trendline1 = new XYLineAnnotation(x1,y2,x2,y2,DOTTED_LINE, Color.orange);
XYLineAnnotation trendline2 = new XYLineAnnotation(x1,y3,x2,y3,DOTTED_LINE, Color.red);
plot.addAnnotation(trendline);
plot.addAnnotation(trendline1);
plot.addAnnotation(trendline2);
plot.setRenderer(renderer1);
Thanks in advance,
Jyothy Anjuri
Fill colours in between trend lines
i have used tried MarkerBand class but not sucedded.
MarkerAxisBand mab = new MarkerAxisBand(rangeAxis1, x1, y1, x2, y2, new Font("Verdana", Font.PLAIN, 10));
IntervalMarker marker = new IntervalMarker(x1, y1);
marker.setPaint(Color.pink);
mab.addMarker(marker);
rangeAxis1.setMarkerBand(mab);
where
Date date = DateUtilities.createDate(2002,MonthConstants.JANUARY,1);
Date date1 = DateUtilities.createDate(2002,MonthConstants.NOVEMBER,31);
double x1 = (double)date.getTime();
double x2 = (double)date1.getTime();
double y1 = 95.35;
double y2 = 96.48;
double y3 = 97.50;
pls advice what is wrong in the code
Jyothy Anjuri
MarkerAxisBand mab = new MarkerAxisBand(rangeAxis1, x1, y1, x2, y2, new Font("Verdana", Font.PLAIN, 10));
IntervalMarker marker = new IntervalMarker(x1, y1);
marker.setPaint(Color.pink);
mab.addMarker(marker);
rangeAxis1.setMarkerBand(mab);
where
Date date = DateUtilities.createDate(2002,MonthConstants.JANUARY,1);
Date date1 = DateUtilities.createDate(2002,MonthConstants.NOVEMBER,31);
double x1 = (double)date.getTime();
double x2 = (double)date1.getTime();
double y1 = 95.35;
double y2 = 96.48;
double y3 = 97.50;
pls advice what is wrong in the code
Jyothy Anjuri
-
- Posts: 15
- Joined: Fri Jul 28, 2006 4:31 pm
How Annotation can be rendered in the back of line graph
Hallo,
Thx, Willi
Did you ever succeed with this? The box annotation is a nice feature, but I need them in the background of the series.Jyothy wrote:I have used XYBoxAnnotation to get the band of colors , but the band is rendered on top of line graph so line graph is not being seen.
Thx, Willi
-
- Posts: 844
- Joined: Fri Oct 13, 2006 9:29 pm
- Location: Sunnyvale, CA
Re: How Annotation can be rendered in the back of line graph
Have you tried using:willi.firulais wrote:The box annotation is a nice feature, but I need them in the background of the series.
Code: Select all
public void addAnnotation(XYAnnotation annotation, Layer layer)
Hope this helps,
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA