Milimetric has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231051
Change subject: Fix annotations beyond last date
......................................................................
Fix annotations beyond last date
Change-Id: I657b2d5fd82f68b985e170bd58bd718f440c6cff
---
M src/components/visualizers/dygraphs-timeseries/bindings.js
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki
refs/changes/51/231051/1
diff --git a/src/components/visualizers/dygraphs-timeseries/bindings.js
b/src/components/visualizers/dygraphs-timeseries/bindings.js
index e1110dd..054b796 100644
--- a/src/components/visualizers/dygraphs-timeseries/bindings.js
+++ b/src/components/visualizers/dygraphs-timeseries/bindings.js
@@ -96,6 +96,13 @@
}
lastDistance = thisDistance;
closestDate = rows[i][0];
+ // if we're at the end, and no date matched,
prefix annotation with date
+ // Also, handle other future dates the same
by decrementing i
+ if (i === rows.length - 1) {
+ a[1] =
moment(a[0]).utc().format('YYYY-MM-DD ') + a[1];
+ i--;
+ break;
+ }
}
return {
// just attach to the first series and show on
X axis
--
To view, visit https://gerrit.wikimedia.org/r/231051
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I657b2d5fd82f68b985e170bd58bd718f440c6cff
Gerrit-PatchSet: 1
Gerrit-Project: analytics/dashiki
Gerrit-Branch: master
Gerrit-Owner: Milimetric <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits