diff --git a/src/kibana/apps/discover/controllers/discover.js b/src/kibana/apps/discover/controllers/discover.js index 1d71d919174d..ca85dcde51aa 100644 --- a/src/kibana/apps/discover/controllers/discover.js +++ b/src/kibana/apps/discover/controllers/discover.js @@ -636,6 +636,7 @@ define(function (require) { type: 'histogram', vislibParams: { addLegend: false, + addEvents: true, addBrushing: true, }, listeners: { diff --git a/src/kibana/components/vis_types/histogram.js b/src/kibana/components/vis_types/histogram.js index 6e4fe01e2d92..537485165d57 100644 --- a/src/kibana/components/vis_types/histogram.js +++ b/src/kibana/components/vis_types/histogram.js @@ -11,8 +11,6 @@ define(function (require) { shareYAxis: true, addTooltip: true, addLegend: true, - addEvents: true, - addBrushing: true }, schemas: new Schemas([ { diff --git a/src/kibana/components/vislib/visualizations/column_chart.js b/src/kibana/components/vislib/visualizations/column_chart.js index e0db32bb983c..423500de5ca5 100644 --- a/src/kibana/components/vislib/visualizations/column_chart.js +++ b/src/kibana/components/vislib/visualizations/column_chart.js @@ -117,6 +117,7 @@ define(function (require) { ColumnChart.prototype.addBarEvents = function (svg, bars, brush) { var events = this.events; var dispatch = this.events._attr.dispatch; + var addBrush = this._attr.addBrushing; var xScale = this.handler.xAxis.xScale; var startXInv; @@ -131,19 +132,21 @@ define(function (require) { d3.event.stopPropagation(); }) .on('mousedown.bar', function () { - var bar = d3.select(this); - var startX = d3.mouse(svg.node()); - startXInv = xScale.invert(startX[0]); - - // Reset the brush value - brush.extent([startXInv, startXInv]); - - // Magic! - // Need to call brush on svg to see brush when brushing - // while on top of bars. - // Need to call brush on bar to allow the click event to be registered - svg.call(brush); - bar.call(brush); + if (addBrush) { + var bar = d3.select(this); + var startX = d3.mouse(svg.node()); + startXInv = xScale.invert(startX[0]); + + // Reset the brush value + brush.extent([startXInv, startXInv]); + + // Magic! + // Need to call brush on svg to see brush when brushing + // while on top of bars. + // Need to call brush on bar to allow the click event to be registered + svg.call(brush); + bar.call(brush); + } }) .on('click.bar', function (d, i) { dispatch.click(events.eventResponse(d, i));