echarts: Y-axis, type:'log' , series type :'bar', the first data value is 0, the bars on charts is not normal.

option = {
    xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
        type: 'log'
    },
    series: [{
        data: [0, 200, 150, 80, 70, 110, 130],
        type: 'bar'
    }]
};

image

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 5
  • Comments: 15 (3 by maintainers)

Most upvoted comments

This issue seems to be related to data preparation, not a ECharts bug. Label priority-high is a kind of a overkill.

I disagree. 0 is a valid integer which should not cause a charting library to break.

@100pah any updates on this?

hello guyz, any update on this ? my data are dynamic and i cant replace the 0 with null or empty data because it’s a big difference in my case , (0 means no traffic and null means i fetched no data at this time), please if someone has a fix let me know

log(0) is -Infinity. So after removing 0 it will be OK. But it is needed to be think whether to trade 0 as an empty data.