如何在区域图表中添加渐变颜色。请帮忙。我需要图表粉红色区域的渐变。
以下是我的代码:
$(function () {
$('#container').highcharts({
chart: {
type: 'area',
animation: {
duration: 1000
}
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
name: 'Dummy Data',
data: [1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4],
color: 'pink'
}]
});
});
答案 0 :(得分:3)
请查看示例http://www.highcharts.com/demo/line-time-series
编辑:
http://jsfiddle.net/sbochan/HkeXp/
fillColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1},
stops: [
[0, '#ff0000'],
[1, '#f4f4f4']
]
},