如何制作带有复选框的分组条形图以隐藏/显示单个系列?
选中此复选框后,应为条形图的每个组添加一个系列。 我想使用 dc.js
输出应与此快照类似。
我的样本数据集
data = [{"under 5 years":12, "5 to 13 years":87, "14 to 17 years":25,"18 to 24 years":15,"25 to 44 years":25,"45 to 64 years":14,"place":"CA"},
{"under 5 years":12, "5 to 13 years":87, "14 to 17 years":25,"18 to 24 years":15,"25 to 44 years":25,"45 to 64 years":14,"place":"TX"},
{"under 5 years":12, "5 to 13 years":87, "14 to 17 years":25,"18 to 24 years":15,"25 to 44 years":25,"45 to 64 years":14,"place":"NY"},
{"under 5 years":12, "5 to 13 years":87, "14 to 17 years":25,"18 to 24 years":15,"25 to 44 years":25,"45 to 64 years":14,"place":"TX"},
{"under 5 years":12, "5 to 13 years":87, "14 to 17 years":25,"18 to 24 years":15,"25 to 44 years":25,"45 to 64 years":14,"place":"FL"},
{"under 5 years":12, "5 to 13 years":87, "14 to 17 years":25,"18 to 24 years":15,"25 to 44 years":25,"45 to 64 years":14,"place":"IL"},
{"under 5 years":12, "5 to 13 years":87, "14 to 17 years":25,"18 to 24 years":15,"25 to 44 years":25,"45 to 64 years":14,"place":"NY"}]