Onclick event of Bubble chart

222 views
Skip to first unread message

Amit Pundir

unread,
Oct 25, 2016, 2:05:33 AM10/25/16
to dc-js user group
Can we add a onclick event on the bubbles of dc js bubble chart?

Gordon Woodhull

unread,
Oct 25, 2016, 2:57:00 AM10/25/16
to dc.js user group
I'd suggest listening to the chart.on('filtered', ...) event, because it tells you whenever the selection changed.


chart.on('filtered', function(chart) {
    console.log(chart.filters());
});

But you certainly can watch onClick as well. It's a public method so if you want to override it and do something in addition to filtering, you can do:

dc.override(chart, 'onClick', function(d) {
    // do something
    return _chart._onClick(d); // call original function, which toggles the filter state and redraws
});

onClick source:


On Oct 25, 2016, at 2:05 AM, Amit Pundir <amitpu...@gmail.com> wrote:

Can we add a onclick event on the bubbles of dc js bubble chart?

--
You received this message because you are subscribed to the Google Groups "dc-js user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/471628ab-c298-4121-b567-7e407e7d7393%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages