feat(graph): graph tooltip sort order PR refactored/changed #4944, changed the layout graph display options, #4944

This commit is contained in:
Torkel Ödegaard
2016-06-15 17:20:55 +02:00
parent ae554a736b
commit 4b78ab5bcd
4 changed files with 23 additions and 25 deletions

View File

@@ -135,13 +135,13 @@ function ($) {
// Dynamically reorder the hovercard for the current time point if the
// option is enabled.
if (panel.tooltip.ordering === 'decreasing') {
if (panel.tooltip.sort === 2) {
seriesHoverInfo.sort(function(a, b) {
return parseFloat(b.value) - parseFloat(a.value);
return b.value - a.value;
});
} else if (panel.tooltip.ordering === 'increasing') {
} else if (panel.tooltip.sort === 1) {
seriesHoverInfo.sort(function(a, b) {
return parseFloat(a.value) - parseFloat(b.value);
return a.value - b.value;
});
}