apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.44k stars 19.61k forks source link

replaceMerge API , if i want to replace series[1], how to deal with this. #14446

Closed baokeyu123 closed 3 years ago

baokeyu123 commented 3 years ago

Version

5.0.2

Steps to reproduce

replaceMerge just replace API in setOption. but i want to just replace series[1].if series is array.

how to resolve this problem。

thanks

What is expected?

resolve problem

What is actually happening?

for example

mychart.setOption({ series: [{ type: 'line', animationDuration: 100, animationEasing: 'linear', data: data }, { type: 'lines', animationDuration: 100, animationEasing: 'linear', data: data }, ] },{replaceMerge :[series[1]]}});


bless for you

@plainheart

echarts-bot[bot] commented 3 years ago

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list.

Have a nice day! 🍵

baokeyu123 commented 3 years ago

@leeight

 {
                type: 'lines',
                coordinateSystem: 'cartesian2d',
                polyline: true,
                effect: {
                    show: true,
                    trailLength: 0,
                    symbol: 'rect',
                    period: 12,  //滑动速度
                    symbolSize: [200, 15],
                    color: 'black',
                    loop: false,
                },
                data: [{
                    coords: [
                        [0, 0],
                        [Distance, 0] 
                    ]
                },],
            }

i don't set API loop:true ,because i want to update data and animation is synchronize,update data exist delay,so i have to rebuild lines animation

thanks~

100pah commented 3 years ago

mychart.setOption({
    series: [{
        // if id is specified, this option will be 
        // merged to the existing series with this id.
        id: 'line_series',
        type: 'line',
        animationDuration: 100,
        animationEasing: 'linear',
        data: data
    }, {
        // if id is not specified, a new series instance 
        // will be created by this option, and the previous
        // series[1] will be removed.
        type: 'lines',
        animationDuration: 100,
        animationEasing: 'linear',
        data: data
    }]
}, {
    replaceMerge: 'series'
});