From 73253bb54d8fbdafaf8a9eb77f006104c2dc689a Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Fri, 30 Aug 2013 14:11:28 -0700 Subject: [PATCH 1/2] added a tooltip settings section to the histogram settings editor. Currently the only setting defines which value is displayed on stacked charts. --- panels/histogram/editor.html | 33 ++++++++++++++++++++------------- panels/histogram/module.js | 11 ++++++++++- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/panels/histogram/editor.html b/panels/histogram/editor.html index 30be4aacbc7..6ace9611b6a 100644 --- a/panels/histogram/editor.html +++ b/panels/histogram/editor.html @@ -1,6 +1,6 @@
- +
@@ -15,8 +15,8 @@ In {{panel.mode}} mode the configured field must be a numeric type
+
Chart Settings
-
Chart Settings
@@ -26,36 +26,43 @@
- +
- +
-
-
+
+
- +
-
+
-
+
-
+
-
+
-
+
-
+
+
Tooltip Settings
+
+
+ + +
+
\ No newline at end of file diff --git a/panels/histogram/module.js b/panels/histogram/module.js index 5bea7af6190..b3ff837544f 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -72,6 +72,9 @@ angular.module('kibana.histogram', []) 'y-axis' : true, percentage : false, interactive : true, + tooltip : { + value_type: 'cumulative' + } }; _.defaults($scope.panel,_d); @@ -426,11 +429,17 @@ angular.module('kibana.histogram', []) var $tooltip = $('
'); elem.bind("plothover", function (event, pos, item) { + var value; if (item) { + if (scope.panel.stack && scope.panel.tooltip.value_type === 'individual') { + value = item.datapoint[1] - item.datapoint[2]; + } else { + value = item.datapoint[1]; + } $tooltip .html( kbn.query_color_dot(item.series.color, 15) + ' ' + - item.datapoint[1].toFixed(0) + " @ " + + value + " @ " + moment(item.datapoint[0]).format('MM/DD HH:mm:ss') ) .place_tt(pos.pageX, pos.pageY); From 603f66eeb12279ed3f0c49396b1b6122a8ef7bdb Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 30 Aug 2013 14:49:36 -0700 Subject: [PATCH 2/2] Add question mark icon for tooltip --- panels/histogram/editor.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panels/histogram/editor.html b/panels/histogram/editor.html index 6ace9611b6a..c200849fa6c 100644 --- a/panels/histogram/editor.html +++ b/panels/histogram/editor.html @@ -62,7 +62,7 @@
Tooltip Settings
- +
\ No newline at end of file