当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - set different colors for columns in highstock

问题描述:

I want to set different color for columns (volume) based on whether the stock moved up or down. So I added 'color' when filling the 'volume' array:

http://jsfiddle.net/vU5Zg/

volume.push({

'x': data[i][0], // the date

'y':data[i][5] // the volume

});

if (i != 0 && data[i][4] < data[i-1][4]) {

volume[i].color = '#DE32AE';

}

But all the columns turns back to black when I clicked '6m' button. How to solve it?

网友答案:

Solved by adding dataGrouping: { enabled: false }, in the plotOptions.

分享给朋友:
您可能感兴趣的文章:
随机阅读: