its possible customize color of the gridLine in eCharts? I want to custom the color of horizontal white line
custom color gridLine echarts
Yes, you can custom this in option yAxis.splitLine.lintStyle.color
,
yAxis : [
{
type : 'value',
splitLine: {
lineStyle: {
color: 'blue'
}
}
}
],
and more detail there
check this demo:
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>
© 2022 - 2024 — McMap. All rights reserved.