Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last TickLabel missing #431

Open
IBPrivate opened this issue Jan 20, 2025 · 2 comments
Open

last TickLabel missing #431

IBPrivate opened this issue Jan 20, 2025 · 2 comments

Comments

@IBPrivate
Copy link

This lib seems to "remove" the highest tick-label from my graph

DateAxis rightAxis = (DateAxis) chart.getXYPlot().getRangeAxis(1);
rightAxis.setAutoRange(true);
rightAxis.setLowerBound(toGraphDate(0));
rightAxis.setMaximumDate(new Date(toGraphDate(2)));

System.out.println(rightAxis.getMinorTickCount());
rightAxis.setMinorTickMarkOutsideLength(10);
DateTickUnit tickUnit = new DateTickUnit(DateTickUnitType.SECOND, 1);
rightAxis.setTickUnit(tickUnit);
rightAxis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"));
rightAxis.setMinorTickCount(1);
System.out.println(rightAxis.getMaximumDate());

I tried the one with the setMaximumDate to 2 (getMaximumDate 00:00:02...) but it somehow misses in the graph chart ticks.

I already tried https://stackoverflow.com/questions/16091206/jfreechart-last-x-axis-label-cut-off but it doesnt work for me

Output:

0
00:00:02

Image

@IBPrivate
Copy link
Author

@IBPrivate
Copy link
Author

Sooo... I found out that JFree has an inconsitency:
NumberAxis: count <= ValueAxis.MAXIMUM_TICK_COUNT
DateAxis: tickDate.before(upperDate)

because of this I had my problem... Ye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant