-
June 23rd, 2009, 12:51 AM
#1
Plotting horizontal markers on Histogram
I'm using the code mentioned below to plot the horizontal lines on histogram but its not working.
double delta = (va.getRange().getLength()/100);
double mean = computeMean(yAxisValues);
double std = computeStandardDeviation(yAxisValues,mean);
double first = (mean + std);
double second = (mean - std);
//ADDING A MARKER AT MEAN + STD
log.debug("$$$$$$$$$" + sigmalinetype);
if(sigmalinetype == 1 || sigmalinetype == 2 ){
Marker target = new IntervalMarker(first,first+delta);
target.setPaint(Color.red);
target.setLabelAnchor(RectangleAnchor.LEFT);
target.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
plot.addRangeMarker(target, Layer.BACKGROUND);
plot.addDomainMarker(target);
}
//ADDING A MARKER AT MEAN - STD
if(sigmalinetype == 1 || sigmalinetype == 3 ){
Marker target1 = new IntervalMarker(second,second+delta);
target1.setPaint(Color.red);
target1.setLabelAnchor(RectangleAnchor.LEFT);
target1.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
plot.addRangeMarker(target1, Layer.BACKGROUND);
plot.addDomainMarker(target1);
}
The same code I have used in scatter chart to plot the markers and its working.Any help in this regard would be gr8ly appreciated.
-
June 23rd, 2009, 05:04 AM
#2
Re: Plotting horizontal markers on Histogram
It would probably help if you explained where the Marker and IntervalMarker classes come from and what variable 'plot' is.
The skill of writing is to create a context in which other people can think...
E. Schlossberg
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|