Adjust chart labels
This commit is contained in:
@@ -98,7 +98,9 @@ public class AnalyticsController {
|
||||
return "";
|
||||
}
|
||||
int labelStep = Math.max(1, (salesDateLabels.size() + 14) / 15);
|
||||
boolean showLabel = index == 0 || index == salesDateLabels.size() - 1 || index % labelStep == 0;
|
||||
int lastIndex = salesDateLabels.size() - 1;
|
||||
boolean nearEnd = index >= Math.max(0, lastIndex - 2);
|
||||
boolean showLabel = index == 0 || nearEnd || index % labelStep == 0;
|
||||
return showLabel ? salesDateLabels.get(index) : "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user