| | | | Browse by category |
Question
When using an IlvLogarithmicAxisTransformer
and setting the data range on an IlvAxis
, this range is not taken into account, is it normal ?
Answer
For instance, if you set the data range 5-1500, using an IlvLogarithmicAxisTransformer
with the default base (base 10), the range gets adjusted to 1-10000.
This is the expected behavior.
When using a logarithmic transformer, the range is taken into account, but is modified to be of the form [10^k, 10^m].
This is the way logarithmic axes are usually drawn.
However, if this behavior is not what you expect, you can use the following workaround:
chart.getXAxis().setTransformer(new IlvLogarithmicAxisTransformer() {
public boolean validateInterval(IlvDataInterval itv) {
boolean modified = false;
if (getLogBase() > 1) {
if (itv.min <= 0) {
itv.min = 1;
modified = true;
}
if (itv.max <= 0) {
itv.max = 1;
modified = true;
}
}
return modified;
}
}
);