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

Fix missing x-Axis on 1D Timeframe #774

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ protected void calculate() {
// now increase the timespan until one is found where all the labels fit nicely. It will often
// be the first one.
index--;
boolean skip;
int fallbackindex = index;
boolean skip, force = false;
do {
skip = false;

Expand Down Expand Up @@ -242,9 +243,14 @@ protected void calculate() {
// }
}
// System.out.println("************");
if (index >= timeSpans.size() - 1)
break; // We reached the end, even though we might not yet have the result we want,
// continuing will lead to an Exception!
if (index >= timeSpans.size() - 1) {
// Nothing matches, as mentioned above, first one is usually the best fit, force it!
force = true;
index = fallbackindex;
continue; // We can't exit just yet, we need to do the calculations above again
}
if (force)
break; // We don't care anymore if it's a match or not, just use it
} while (skip
|| !areAllTickLabelsUnique(tickLabels)
|| !willLabelsFitInTickSpaceHint(tickLabels, gridStepInChartSpace));
Expand Down