在vue中使用highcharts如何更改图表颜色为渐变色
想要更改颜色只需要在series里面添加
lineColor: "#12DAFB",
// color: "#12DAFB",
color: {
fillOpacity: 0.05,
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, "rgba(14,236,248,0.99)"],
[1, "rgba(255,255,255,0.05)"]
]
},
相同的方法在series里面添加
{
name: "东京",
color: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, "#F1F20C"],
[1, "#0EECF8"]
]
},
data: [5, 8, 2, 3]
},
{
name: "纽约",
color: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, "#FF9501"],
[1, "#0EECF8"]
]
},
data: [6, 8, 5, 4]
},
{
name: "伦敦",
color: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, "#7C6DFE"],
[1, "#0EECF8"]
]
},
data: [9, 8, 3, 4]
},
{
name: "柏林",
color: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, "#51CC64"],
[1, "#0EECF8"]
]
},
data: [4, 2, 5, 7]
}
这样就变成渐变色啦!!!