Google Charts - Multiple Category Filters - Restricting options?

徘徊边缘 提交于 2021-02-08 03:50:21

问题


I have 3 suppliers, 40 brands and 120 products, all displayed in three category filters. When a user selects one supplier from the Supplier filter, I want the Brand filter to hide all brands that are not provided by that supplier. Likewise, when a brand is selected, I want to hide the irrelevant products from the Products filter. I don't really care about what's being shown in the table at this point.

Is there any way to implement something like this?


回答1:


Heres an example for you -

http://jsfiddle.net/danabnormal/cjn2tbbm

You can do this by creating a Dashboard. At around line 61 you can see that the selection made in the 'Sex' drop down is bound to the 'Name' dropdown, thus limiting what Names can be selected.

dashboard.bind(filterSex, filterName);
dashboard.bind(filterSex, pieChart);


来源:https://stackoverflow.com/questions/31246895/google-charts-multiple-category-filters-restricting-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!