Skip to content

Gauge with dataset: data disappears when using myChart.setOption( modify, false) to update the dataset. #10945

@yongnny

Description

@yongnny

Version

4.2.1

Reproduction link

https://www.echartsjs.com/examples/editor.html?c=gauge

Steps to reproduce

option = {
    backgroundColor: '#FFF',
    tooltip : {
        formatter: "{a} <br/>{b} : {c}%"
    },
    toolbox: {
        feature: {
            restore: {},
            saveAsImage: {}
        }
    },
    dataset : {
        source : [[10], [30]]
    },
    series: [
        {
            name: '业务指标',
            type: 'gauge',
            detail: {formatter:'{value}%'},
            //data: [{value: 50, name: '完成率'}]
        }
    ]
};

setInterval(function () {
    //option.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
    
    //var ttt = myChart.getOption();
    
    var ttt = {
         dataset : {
            source : [[15], [67]]
        }
    }
    
    // var ttt = {
    //     backgroundColor: '#FFC',
    // }
    
    myChart.setOption(ttt);
},2000);

What is expected?

仪表盘 的数据 被成功更新

What is actually happening?

仪表盘 不显示指针,而是 NaN

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions