Explorar el Código

highlight series name in tooltip when shared tooltip active

Mitsuhiro Tanda hace 9 años
padre
commit
0a13b7c559
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      public/app/plugins/panel/graph/graph_tooltip.js

+ 6 - 1
public/app/plugins/panel/graph/graph_tooltip.js

@@ -142,11 +142,16 @@ function ($) {
             continue;
             continue;
           }
           }
 
 
+          var highlightStyle = '';
+          if (item && i === item.seriesIndex) {
+            highlightStyle = ' style="font-weight: bold;"';
+          }
+
           series = seriesList[i];
           series = seriesList[i];
 
 
           value = series.formatValue(hoverInfo.value);
           value = series.formatValue(hoverInfo.value);
 
 
-          seriesHtml += '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name">';
+          seriesHtml += '<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name"' + highlightStyle + '>';
           seriesHtml += '<i class="fa fa-minus" style="color:' + series.color +';"></i> ' + series.label + ':</div>';
           seriesHtml += '<i class="fa fa-minus" style="color:' + series.color +';"></i> ' + series.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);