update Rowchart counts for multiple tags

26 views
Skip to first unread message

Olivier Nérot

unread,
Mar 3, 2015, 8:59:04 AM3/3/15
to dc-js-us...@googlegroups.com
Hello,

Following several proposals, I am trying to create a rowchart to filter items linked to several tags. 
I want to filter data which have one or several selected tags, inside a rowchart counting them.

var data = [
    {id:1, tags: [1,2,3]},
    {id:2, tags: [3]},
    {id:3, tags: [1]},
    {id:4, tags: [2,3]},
    {id:5, tags: [3]},
    {id:6, tags: [1,2,3]},
    {id:7, tags: [1,2]}
]; 

It mainly works, as it can be seen here :

Nevertheless, I am unable to update the rowchart when a tag is selected. For example, if I filter the data by clicking on the '2' tag, I would like to have the rowchart modified, with '1' and '3' tags lowered to 3...
I think it comes from the fact that crossfilter doesn't update the grouping of the charts doing the filtering, and I would like to force it to update.

Does it sound possible ?

Thanks.

Olivier

Olivier Nérot

unread,
Mar 5, 2015, 3:28:26 AM3/5/15
to dc-js-us...@googlegroups.com
If it helps, I've finally found a working solution, thanks to many helps and code example on github and forums. Thanks to all.
The solution was to duplicate the 'tags' dimension, and use the duplicated dimension to filter the group.


And for those who are looking for a multiple tags filter, the following code works :

Reply all
Reply to author
Forward
0 new messages