我正在尝试实现这个简单的仪表板来处理我的后端。问题是后端并不总是提供相同数量的“类别”,因此条形图没有按需要工作。我已经创建了一个处理示例数据的工具,在饼图中单击不同的“组”之后就会出现这个问题。
function up(d, i) {
/* update bar chart when user selects piece of the pie chart */
//updateBarChart(dataset[i].category);
updateBarChart(d.data.category, color(