When using an IlvLogarithmicAxisTransformer and setting the data range on an IlvAxis, this range is not taken into account

Article ID: 2297
Last updated: 30 May, 2018
Article ID: 2297
Last updated: 30 May, 2018
Revision: 3
Views: 704
Posted: 21 Apr, 2005
by Dean J.
Updated: 30 May, 2018
by Gargani A.

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;
}
}
);

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2297
Last updated: 30 May, 2018
Revision: 3
Views: 704
Posted: 21 Apr, 2005 by Dean J.
Updated: 30 May, 2018 by Gargani A.
Also listed in


Others in this category