search

Home  >  Q&A  >  body text

echart data display missing - Stack Overflow

The code is like this

;(function(){
    var lineChart = echarts.init(document.getElementById('sparkline'));
    // 指定图表的配置项和数据
    var option = {
        color: ['#fff'],
        grid: {
            bottom: 0,
            top: 0,
            left: 0,
            right: 0
        },
        tooltip: {
            show: true,
            trigger: 'item',
            formatter: '{b} : {c}'
        },
        xAxis: {
            show: false,
            data: ['星期一','星期二','星期三','星期四','星期五','星期六','星期日']
        },
        yAxis: {
            show: false
        },
        series: [{
            name: '最近7日浏览量',
            type: 'line',
            data: [5, 20, 36, 10, 10, 20, 20]
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    lineChart.setOption(option);
})()

The icon displayed is like this

Only 6 data are displayed, and there are problems with the 3 and 5 data display

巴扎黑巴扎黑2810 days ago558

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-05-19 10:30:55

    No problem, it’s correct, all the data is displayed, but some data points are not displayed. The default is like this, you are

        series: [{
            name: '最近7日浏览量',
            type: 'line',
            data: [5, 20, 36, 10, 10, 20, 20]
        }]

    Add showAllSymbol:true configuration here, then all the points will be displayed.

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-19 10:30:55

    It’s not lost, brother

    reply
    0
  • ringa_lee

    ringa_lee2017-05-19 10:30:55

    I tried it with your configuration and it’s fine. Let’s take a closer look

    reply
    0
  • Cancelreply