如何让dc.js饼图正确显示数据?

时间:2016-03-06 19:16:43

标签: dc.js

我有这个小提琴,我试图让dc.js饼图显示我的数据集中的5个“区域”:https://jsfiddle.net/eugene_goldberg/yv3nnred/6/ 这是数据集:

var data = [
        {date: "2015-03-25T12:10:00", resolver: "Group 1",  escalation_pct: 20, bubble: 5, region: "Americas", x: 1},
        {date: "2015-03-25T12:15:00", resolver: "Group 2",  escalation_pct: 10,  bubble: 5, region: "AMEA",  x: 1},
        {date: "2015-03-25T12:25:00", resolver: "Group 3",  escalation_pct: 50, bubble: 10, region: "Nordics", x: 1},
        {date: "2015-03-25T12:40:00", resolver: "Group 4",  escalation_pct: 30,  bubble: 1, region: "Americas", x: 1},
        {date: "2015-03-25T12:35:00", resolver: "Group 5",  escalation_pct: 5, bubble: 10, region: "Australia", x: 1},
        {date: "2015-03-25T12:45:00", resolver: "Group 6",  escalation_pct: 13,  bubble: 1, region: "UK&I", x: 1}
    ];

由于某种原因,饼图无法正确显示区域名称。 它还有一个明亮的橙色切片,而我没有指定任何特定的颜色。 我该怎么做才能解决这个问题?

1 个答案:

答案 0 :(得分:2)

你有.slicesCap(4),这意味着(我相信)它会显示4个切片加上一个"其他"切片。如果您将其更改为.slicesCap(5)或只是删除它,它将开始显示您的UK& I切片。