Hi all,
I need to show some particular values on a logAxis domain (used in CategoryAxis plot).
I've overridden the RefreshTick method like that:
rangeAxisY = new LogAxis(labelYaxis){
@Override
public List refreshTicks(Graphics2D g2, AxisState state,
Rectangle2D dataArea, RectangleEdge edge) {
List myTicks = new ArrayList();
myTicks.add(new NumberTick(
TickType.MINOR,
0.0f,
"0",
TextAnchor.CENTER_RIGHT,
TextAnchor.CENTER_RIGHT,
0.0));
myTicks.add(new NumberTick(
TickType.MINOR,
25.0f,
"25",
TextAnchor.CENTER_RIGHT,
TextAnchor.CENTER_RIGHT,
0.0));
myTicks.add(new NumberTick(
TickType.MINOR,
25.0f,
"300",
TextAnchor.CENTER_RIGHT,
TextAnchor.CENTER_RIGHT,
0.0));
return myTicks;
}
};
and the range is
rangeAxisY.setDefaultAutoRange(new Range(0,1000));
rangeAxisY.setTickLabelsVisible(true);
rangeAxisY.setTickMarksVisible(true);
...but I still see only the "300" named line, nothing else
What's wrong?
thank you for support!
MM.
LogAxis - Redefinition of tick labels seems not to be showed
-
- Posts: 4
- Joined: Tue Sep 09, 2014 2:57 pm
- antibot: No, of course not.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: LogAxis - Redefinition of tick labels seems not to be sh
There are two issues I think:
- zero never appears on the axis because log values are only defined for positive numbers - getSmallestValue() returns the smallest value that will be displayed on the axis;
- you have specified 25.0 as the value for both the other tick values, you should change the last one to 300.
- zero never appears on the axis because log values are only defined for positive numbers - getSmallestValue() returns the smallest value that will be displayed on the axis;
- you have specified 25.0 as the value for both the other tick values, you should change the last one to 300.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program