Hello, everybody!
I'd like to ask you for advise.
I have DateAxis and it displays ticks like: 2006, 2007 etc.
But I have big amount of values, so I don't need to display all of them -
I've made them so they display like 2006 ... 2011 ... 2016 etc.
And from the other side, I need first and last tick to be shown anyway.
Now I have cases when 1st and last tick are invisible.
Can anybody answer me if I can dispaly axis ticks with some periodicity and
first and list values ticks must be shown.
Thank you for any answer.
Manipulation with Ticks near the DateAxis
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
This is a limitation of the DateAxis. It can probably be fixed, but it would need some extra code to detect overlapping labels. Please submit a feature request on the SourceForge page, if there isn't one there already.
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
Re: Manipulation with Ticks near the DateAxis
Hi David,
I came across same scenarios, please let me know weather this issue has been fixed.
I am just describing my scenarion below
I have Time Series on x-axis ranges from start date to end date. My logic is if the days are more than 30 then I am setting setAutoRange(true) , it is working but it is not displaying the start date and end date on x-axis. Then I added below logic but still it's not displaying start date and end date because tick unit gap. Please help me here. It's kind of urgent.
axis.setRange(lowerDate, upperDate);
if (daysDiff > 60 && daysDiff <= 150) {
axis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 5));
} else if (daysDiff > 150 && daysDiff <= 300) {
axis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 10));
} else if (daysDiff > 300){
axis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 13));
}
I came across same scenarios, please let me know weather this issue has been fixed.
I am just describing my scenarion below
I have Time Series on x-axis ranges from start date to end date. My logic is if the days are more than 30 then I am setting setAutoRange(true) , it is working but it is not displaying the start date and end date on x-axis. Then I added below logic but still it's not displaying start date and end date because tick unit gap. Please help me here. It's kind of urgent.
axis.setRange(lowerDate, upperDate);
if (daysDiff > 60 && daysDiff <= 150) {
axis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 5));
} else if (daysDiff > 150 && daysDiff <= 300) {
axis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 10));
} else if (daysDiff > 300){
axis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, 13));
}
Re: Manipulation with Ticks near the DateAxis
Hi Dave,
Could you let me know the solution for that.
I am trying to show both start date and end date on axis as mandatory and adjust the in between dates. It's very urgent for me.
- Sri
Could you let me know the solution for that.
I am trying to show both start date and end date on axis as mandatory and adjust the in between dates. It's very urgent for me.
- Sri