gpt4 book ai didi

echarts - 自定义颜色 gridLine echarts

转载 作者:行者123 更新时间:2023-12-05 01:16:39 28 4
gpt4 key购买 nike

是否可以自定义eCharts中gridLine的颜色? I want to custom the color of horizontal white line

最佳答案

是的,您可以在选项 yAxis.splitLine.lintStyle.color 中自定义它,

yAxis : [
{
type : 'value',
splitLine: {
lineStyle: {
color: 'blue'
}
}
}
],

以及更多详情 there

查看此演示:

let echartsObj = echarts.init(document.querySelector('#canvas'));

option = {
color: ['#3398DB'],
xAxis : [
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
}
],
yAxis : [
{
type : 'value',
splitLine: {
lineStyle: {
color: 'blue'
}
}
}
],
series : [
{
name:'metric',
type:'bar',
data:[10, 52, 200, 334, 390, 330, 220]
}
]
};


echartsObj.setOption(option)
<html>
<header>
<script src="https://cdn.bootcss.com/echarts/4.1.0.rc2/echarts-en.min.js"></script>
</header>
<body>
<div id="canvas" style="width: 100%; height: 300px">
</div>
</body>
</html>

关于echarts - 自定义颜色 gridLine echarts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53068456/

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