酒窝图颜色变化不起作用

dimple chart color change not working

你能帮我解决我的问题吗? 我目前在这张 contrinents/country 图表上: http://jsbin.com/yigomu/1/edit?html,js,output

我想知道为什么在这个例子中没有显示颜色变化: 1 条蓝色,1 条红色,然后 1 条蓝色,1 条红色,依此类推。 http://jsfiddle.net/uafGn/

即使酒窝图表的设置相同。

x = chart.addCategoryAxis("x", ["Fruit", "Year"]);
x.addGroupOrderRule([2012, 2013]);

我什么都试过了,就是没用...

您可以像这样更改图表颜色。

chart.defaultColors = [
    new dimple.color("red"),
    new dimple.color("blue"),
]; 

在 addSeries 函数中指定的最后一个字段使颜色变得浅浅。因此,您只需要在此处包含要着色的维度:

myChart.addSeries("Point", dimple.plot.bar);

变为:

myChart.addSeries(["Point", "Year"], dimple.plot.bar);

编辑:

实际上看你的例子,系列中不需要 "Point"。它应该只是:

myChart.addSeries("Year", dimple.plot.bar);