Commit bcdddfe4 by bergquist

style(tooltip): removed comment and extrated sort

parent c4ca1444
...@@ -126,10 +126,7 @@ function ($) { ...@@ -126,10 +126,7 @@ function ($) {
relativeTime = dashboard.getRelativeTime(seriesHoverInfo.time); relativeTime = dashboard.getRelativeTime(seriesHoverInfo.time);
absoluteTime = dashboard.formatDate(seriesHoverInfo.time); absoluteTime = dashboard.formatDate(seriesHoverInfo.time);
// Dynamically reorder the hovercard for the current time point. seriesHoverInfo.sort(byToolTipValue);
seriesHoverInfo.sort(function(a, b) {
return parseFloat(b.value) - parseFloat(a.value);
});
for (i = 0; i < seriesHoverInfo.length; i++) { for (i = 0; i < seriesHoverInfo.length; i++) {
hoverInfo = seriesHoverInfo[i]; hoverInfo = seriesHoverInfo[i];
...@@ -179,5 +176,9 @@ function ($) { ...@@ -179,5 +176,9 @@ function ($) {
}); });
} }
function byToolTipValue(a, b) {
return parseFloat(b.value) - parseFloat(a.value);
}
return GraphTooltip; return GraphTooltip;
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment