dimple chart color change not working

168 views Asked by At

can you help me with my problem pls? I'm currently on this contrinents/country graph: http://jsbin.com/yigomu/1/edit?html,js,output

I would like to know why it's not showing the color change on this example: 1 bar blue, 1 bar red, then again 1 bar blue, 1 bar red and so on. http://jsfiddle.net/uafGn/

Even if the settings for the dimple chart are the same.

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

I tried everything, it's just not working...

2

There are 2 answers

0
John Kiernander On BEST ANSWER

Dimple colours by the last field specified in the addSeries function. So you just need to include the dimension you want to colour by there:

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

becomes:

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

EDIT:

Actually looking at your example there is no need for "Point" in the series. It should just be:

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

You can change the charts colors like this.

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