Skip to content

Commit

Permalink
Re-add code removed from 1.5 to support clicking on a bar to filter f…
Browse files Browse the repository at this point in the history
…or ordinal barCharts
  • Loading branch information
PasghettiCode authored and jrideout committed Aug 31, 2013
1 parent 66699b1 commit 8b3c6ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions dc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2500,6 +2500,9 @@ dc.barChart = function (parent, chartGroup) {
})
.append("title").text(_chart.title());

if (_chart.isOrdinal())
bars.on("click", onClick);

dc.transition(bars, _chart.transitionDuration())
.attr("x", function (d) {
var x = _chart.x()(d.x);
Expand Down Expand Up @@ -2583,6 +2586,10 @@ dc.barChart = function (parent, chartGroup) {
return _chart;
};

function onClick(d) {
_chart.onClick(d.data);
}

_chart.gap = function (_) {
if (!arguments.length) return _gap;
_gap = _;
Expand Down
Loading

0 comments on commit 8b3c6ff

Please sign in to comment.