gpt4 book ai didi

css - 如何使用 highcharts 实现此图

转载 作者:太空宇宙 更新时间:2023-11-04 02:22:39 25 4
gpt4 key购买 nike

我怎样才能使下面的图表尽可能准确?

我正在尝试用 highcharts 实现下图中的图表,我遇到的问题是我无法实现渐变和紫色切割线

这是我目前所做的:jsFiddle

$(function () {
$('#container').highcharts({
chart: {
type: 'areaspline'
},
options: {
title: {
text: "Historical report"
},
heigth: 200

},
legend: {
layout: 'vertical',
align: 'left',
verticalAlign: 'top',
x: 150,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
},
xAxis: {
categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
plotBands: [
{
from: 4.5,
to: 6.5,
color: 'rgba(68, 170, 213, .2)'
}
]
},
yAxis: {
title: {
text: 'Fruit units'
}
},
tooltip: {
shared: true,
valueSuffix: ' units'
},
credits: {
enabled: false
},
plotOptions: {
areaspline: {
fillOpacity: 0.5
}
},
series: [
{
name: 'John',
data: [3, 9, null, 5, 4, 10, 12],
lineColor: "#5A66AF"
}, {
name: 'Jane',
data: [1, 10, null, 3, 3, 5, 4],
lineColor: '#47a06b'
}, {
name: 'Roberto',
data: [10, 15, null, 15, 9, 9, 4],
lineColor: '#2ba9db'
}
]
});

});

enter image description here

最佳答案

线条由DashStyle属性实现:

渐变填充是在 fillColor 属性中定义渐变停止点的问题:

(尽管如此,FWIW,渐变的极端白色端 reeeeally 让人分心......)

关于css - 如何使用 highcharts 实现此图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37889626/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com