custom color gridLine echarts
Asked Answered
F

1

6

its possible customize color of the gridLine in eCharts? I want to custom the color of horizontal white line

Fick answered 30/10, 2018 at 16:6 Comment(0)
V
12

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>
Vraisemblance answered 31/10, 2018 at 2:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.