admin管理员组文章数量:1200383
I need to figure out how to color the same data series points with different colors in Highcharts. For example, let's say I have a data series for several days and I would like to have a line graph. In this line specific days should be distinguish (maybe colored by some color).
I need to figure out how to color the same data series points with different colors in Highcharts. For example, let's say I have a data series for several days and I would like to have a line graph. In this line specific days should be distinguish (maybe colored by some color).
Share Improve this question asked Jul 10, 2012 at 15:18 whiteErruwhiteErru 2751 gold badge5 silver badges13 bronze badges 2- What have you tried? – Event_Horizon Commented Jul 10, 2012 at 15:32
- highcharts.com/stock/ref/#series – Ricardo Lohmann Commented Jul 10, 2012 at 17:40
4 Answers
Reset to default 11In your data, you can specify the color of the specific points:
data: [{
name: 'Point 1',
color: '#00FF00',
y: 0
}, {
name: 'Point 2',
color: '#FF00FF',
y: 5
}]
For line charts, use "fill color", as explained in the answer below.
For an example in jsFiddle, see http://jsfiddle.net/xqWp5/1/
Try using the fillColor
property:
{
name: 'xyz',
x: 123,
y: 456,
fillColor: '#00FF00'
}
Yes you can just use plotOptions.area.zones :
https://api.highcharts.com/highcharts/plotOptions.area.zones
see the example :
plotOptions: {
series: {
zoneAxis: "x",
zones: [{
value: 0,
className: 'zone-0'
}, {
value: 10,
className: 'zone-1'
}, {
className: 'zone-2'
}],
threshold: -10
}
},
http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/css/color-zones/
With the zoneAxis: "x"
you can specify which axis you use to discriminate your differents colors.
You you would like to have colored line partially, you need to have as much series as colors. In other words, each color should be separate series with defined color.
本文标签: javascriptHighchart data series filled with different colorsStack Overflow
版权声明:本文标题:javascript - Highchart data series filled with different colors - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738581326a2101180.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论