Hello,
I have a chart with some plots with markers that sometimes fall outside data ranges, and don't drawn in axis setAutoRange(true).
Is there any way for draw automatically this markers?
Regards.
Marker outside Axis range
You could extend your dataset to implement the RangeInfo interface.
Code: Select all
public class MyDefaultXYDataset extends DefaultXYDataset implements RangeInfo{
public double getRangeLowerBound(boolean includeInterval) {
return getRangeBounds(includeInterval).getLowerBound();
}
public double getRangeUpperBound(boolean includeInterval) {
return getRangeBounds(includeInterval).getUpperBound();
}
public Range getRangeBounds(boolean includeInterval) {
Range result = DatasetUtilities.iterateRangeBounds(this, includeInterval);
//Put you own checks here, perhaps checking the min/max value of your range markers
if(result.getLowerBound() > -20){
result = new Range(-20, result.getUpperBound());
}
if(result.getUpperBound() < 20){
result = new Range(result.getLowerBound(), 20);
}
return result;
}
}
The answer does not come from thinking outside the box, rather the answer comes from realizing the truth; There is no Box. my js site