1

I am building up a bar chart using Echarts, Dose anyone know how to implement a margin between start point and 0 scale on y-axis?

The expect effects of y-axis like this

  • You should include some of your code to show what you are working with, it makes it easier to make suggestions. – Tom Aug 06 '21 at 17:23

1 Answers1

2

This has been solved.

xAxis: {
    type: 'category',
    data: {},
    axisTick: {
      //...
    },
    axisLine: {
        onZero: false // This is important, so x axis can start from non-zero number
    }
},
yAxis: {
    splitLine: { show: false },
    max: 'dataMax',
    type: 'value',
    min: -7 // This is also important, y axis can start from a negative number
}