From 5646d173cc17c5d23ba93b9238e86bee33bb3fa6 Mon Sep 17 00:00:00 2001 From: Khalah Jones-Golden Date: Tue, 26 May 2015 14:16:22 -0400 Subject: [PATCH] [Tooltip] Changed the way the tooltip functions to make up for the fact firefox doesn't have certain properties on the event and event target --- .../vislib/visualizations/_point_series_chart.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kibana/components/vislib/visualizations/_point_series_chart.js b/src/kibana/components/vislib/visualizations/_point_series_chart.js index 115f9e7ce6ad9..5a31a58fc84cb 100644 --- a/src/kibana/components/vislib/visualizations/_point_series_chart.js +++ b/src/kibana/components/vislib/visualizations/_point_series_chart.js @@ -1,5 +1,6 @@ define(function (require) { return function PointSeriesChartProvider(d3, Private) { + var $ = require('jquery'); var _ = require('lodash'); var Chart = Private(require('components/vislib/visualizations/_chart')); @@ -48,6 +49,7 @@ define(function (require) { * @returns {D3.Selection} */ PointSeriesChart.prototype.createEndZones = function (svg) { + var $chartEl = $(this.chartEl); var xAxis = this.handler.xAxis; var xScale = xAxis.xScale; var yScale = xAxis.yScale; @@ -100,19 +102,22 @@ define(function (require) { function callPlay(event) { var boundData = event.target.__data__; + var offsetX = $chartEl.offset().left; var wholeBucket = boundData && boundData.x != null; + // the min and max that the endzones start in var min = leftEndzone.w; var max = rightEndzone.x; // bounds of the cursor to consider - var xLeft = event.offsetX; - var xRight = event.offsetX; + var xLeft = event.clientX - offsetX; + var xRight = event.clientX - offsetX; if (wholeBucket) { xLeft = xScale(boundData.x); xRight = xScale(xAxis.addInterval(boundData.x)); } + return { wholeBucket: wholeBucket, touchdown: min > xLeft || max < xRight @@ -133,4 +138,4 @@ define(function (require) { return PointSeriesChart; }; -}); \ No newline at end of file +});