Skip to content

Commit 9156e7f

Browse files
committed
update-sites/stats: help the final label be shown
Dygraphs appears to treat the end of the active time range as an exclusive bound for the purpose of deciding whether each tick's label should be rendered. We want the final tick to be rendered even though it describes the final data point in the chart's initial data range.
1 parent 8114a1f commit 9156e7f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

_pages/update-sites/stats.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,14 @@ Note:
552552
chartConfig.ylabel = yLabel;
553553
}
554554

555+
// Extend the date window slightly to ensure final tick label is within bounds
556+
if (data && data.length > 0) {
557+
chartConfig.dateWindow = [
558+
data[0][0].getTime(),
559+
data[data.length-1][0].getTime() + 1 // Add a sliver of time
560+
];
561+
}
562+
555563
new Dygraph(document.getElementById("stats-chart"), data, chartConfig);
556564

557565
} catch (error) {

0 commit comments

Comments
 (0)