[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

This commit is contained in:
Khalah Jones-Golden 2015-05-26 14:16:22 -04:00
parent d6a90b2806
commit 0bd6a5994b

View file

@ -48,6 +48,7 @@ define(function (require) {
* @returns {D3.Selection}
*/
PointSeriesChart.prototype.createEndZones = function (svg) {
var self = this;
var xAxis = this.handler.xAxis;
var xScale = xAxis.xScale;
var yScale = xAxis.yScale;
@ -100,19 +101,22 @@ define(function (require) {
function callPlay(event) {
var boundData = event.target.__data__;
var mouseChartXCoord = event.clientX - self.chartEl.getBoundingClientRect().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 = mouseChartXCoord;
var xRight = mouseChartXCoord;
if (wholeBucket) {
xLeft = xScale(boundData.x);
xRight = xScale(xAxis.addInterval(boundData.x));
}
return {
wholeBucket: wholeBucket,
touchdown: min > xLeft || max < xRight
@ -133,4 +137,4 @@ define(function (require) {
return PointSeriesChart;
};
});
});