Browse Source

Graph: Fix for tooltip series order when series draw order was changed with zindex property, Fixes #1108

Torkel Ödegaard 11 years ago
parent
commit
9594effb6c
2 changed files with 4 additions and 2 deletions
  1. 1 0
      CHANGELOG.md
  2. 3 2
      src/app/panels/graph/graph.js

+ 1 - 0
CHANGELOG.md

@@ -12,6 +12,7 @@
 - [Issue #1136](https://github.com/grafana/grafana/issues/1136). Graph: Fix to legend value Max and negative values
 - [Issue #1150](https://github.com/grafana/grafana/issues/1150). SinglestatPanel: Fixed absolute drilldown link issue
 - [Issue #1123](https://github.com/grafana/grafana/issues/1123). Firefox: Workaround for Firefox bug, casued input text fields to not be selectable and not have placeable cursor
+- [Issue #1108](https://github.com/grafana/grafana/issues/1108). Graph: Fix for tooltip series order when series draw order was changed with zindex property
 
 # 1.9.0-rc1 (2014-11-17)
 

+ 3 - 2
src/app/panels/graph/graph.js

@@ -26,6 +26,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
       link: function(scope, elem) {
         var dashboard = scope.dashboard;
         var data, annotations;
+        var sortedSeries;
         var legendSideLastValue = null;
         scope.crosshairEmiter = false;
 
@@ -204,7 +205,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
           addAnnotations(options);
           configureAxisOptions(data, options);
 
-          var sortedSeries = _.sortBy(data, function(series) { return series.zindex; });
+          sortedSeries = _.sortBy(data, function(series) { return series.zindex; });
 
           function callPlot() {
             try {
@@ -430,7 +431,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
         }
 
         new GraphTooltip(elem, dashboard, scope, function() {
-          return data;
+          return sortedSeries;
         });
 
         elem.bind("plotselected", function (event, ranges) {