|
@@ -81,9 +81,9 @@ function ($) {
|
|
|
// Stacked series can increase its length on each new stacked serie if null points found,
|
|
// Stacked series can increase its length on each new stacked serie if null points found,
|
|
|
// to speed the index search we begin always on the last found hoverIndex.
|
|
// to speed the index search we begin always on the last found hoverIndex.
|
|
|
var newhoverIndex = this.findHoverIndexFromDataPoints(pos.x, series, hoverIndex);
|
|
var newhoverIndex = this.findHoverIndexFromDataPoints(pos.x, series, hoverIndex);
|
|
|
- results.push({ value: value, hoverIndex: newhoverIndex });
|
|
|
|
|
|
|
+ results.push({ value: value, hoverIndex: newhoverIndex, color: series.color, label: series.label });
|
|
|
} else {
|
|
} else {
|
|
|
- results.push({ value: value, hoverIndex: hoverIndex });
|
|
|
|
|
|
|
+ results.push({ value: value, hoverIndex: hoverIndex, color: series.color, label: series.label });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -133,6 +133,18 @@ function ($) {
|
|
|
|
|
|
|
|
absoluteTime = dashboard.formatDate(seriesHoverInfo.time, tooltipFormat);
|
|
absoluteTime = dashboard.formatDate(seriesHoverInfo.time, tooltipFormat);
|
|
|
|
|
|
|
|
|
|
+ // Dynamically reorder the hovercard for the current time point if the
|
|
|
|
|
+ // option is enabled.
|
|
|
|
|
+ if (panel.tooltip.ordering === 'decreasing') {
|
|
|
|
|
+ seriesHoverInfo.sort(function(a, b) {
|
|
|
|
|
+ return parseFloat(b.value) - parseFloat(a.value);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (panel.tooltip.ordering === 'increasing') {
|
|
|
|
|
+ seriesHoverInfo.sort(function(a, b) {
|
|
|
|
|
+ return parseFloat(a.value) - parseFloat(b.value);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
for (i = 0; i < seriesHoverInfo.length; i++) {
|
|
for (i = 0; i < seriesHoverInfo.length; i++) {
|
|
|
hoverInfo = seriesHoverInfo[i];
|
|
hoverInfo = seriesHoverInfo[i];
|
|
|
|
|
|
|
@@ -150,7 +162,7 @@ function ($) {
|
|
|
value = series.formatValue(hoverInfo.value);
|
|
value = series.formatValue(hoverInfo.value);
|
|
|
|
|
|
|
|
seriesHtml += '<div class="graph-tooltip-list-item ' + highlightClass + '"><div class="graph-tooltip-series-name">';
|
|
seriesHtml += '<div class="graph-tooltip-list-item ' + highlightClass + '"><div class="graph-tooltip-series-name">';
|
|
|
- seriesHtml += '<i class="fa fa-minus" style="color:' + series.color +';"></i> ' + series.label + ':</div>';
|
|
|
|
|
|
|
+ seriesHtml += '<i class="fa fa-minus" style="color:' + hoverInfo.color +';"></i> ' + hoverInfo.label + ':</div>';
|
|
|
seriesHtml += '<div class="graph-tooltip-value">' + value + '</div></div>';
|
|
seriesHtml += '<div class="graph-tooltip-value">' + value + '</div></div>';
|
|
|
plot.highlight(i, hoverInfo.hoverIndex);
|
|
plot.highlight(i, hoverInfo.hoverIndex);
|
|
|
}
|
|
}
|