Skip to content

Commit

Permalink
Fix for #67 - Scale Chart X axis when layers > 100
Browse files Browse the repository at this point in the history
  • Loading branch information
sco01 committed Oct 4, 2019
1 parent d858ce2 commit a69269f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion octoprint_dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def psUtilGetStats(self):
def on_after_startup(self):
self._logger.info("Dashboard started")

self.timer = RepeatedTimer(2.0, self.send_notifications, run_first=True)
self.timer = RepeatedTimer(3.0, self.send_notifications, run_first=True)
self.timer.start()

def send_notifications(self):
Expand Down
8 changes: 3 additions & 5 deletions octoprint_dashboard/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,9 @@ $(function () {
showGrid: false,
showLabel: true,
labelInterpolationFnc: function skipLabels(value, index, labels) {
if(labels.length > 100) {
return index % 8 === 0 ? value : null;
}
else if(labels.length > 50) {
return index % 4 === 0 ? value : null;
let labelScale = Math.round( ( labels.length + 60 ) / 10 );
if(labels.length > 40) {
return index % labelScale === 0 ? value : null;
} else {
return value;
}
Expand Down

0 comments on commit a69269f

Please sign in to comment.