apache / echarts

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

极坐标下负值数据渲染错误 #14627

Closed Wuli-Zhang closed 3 years ago

Wuli-Zhang commented 3 years ago

Version

5.0.0

Steps to reproduce

初始化极坐标图表,然后显示正常数据,当setoption为负值时,渲染方向无变化,依旧正向渲染,导致显示错误。

option = {
    angleAxis: {
    },
    radiusAxis: {
        type: 'category',
        data: ['周一'],
        z: 10
    },
    polar: {
    },
    series: [{
        type: 'bar',
        data: [1],
        coordinateSystem: 'polar',
        name: 'A',
        emphasis: {
            focus: 'series'
        }
    }, {
        type: 'bar',
        data: [2],
        coordinateSystem: 'polar',
        name: 'B',
        emphasis: {
            focus: 'series'
        }
    }, {
        type: 'bar',
        data: [1],
        coordinateSystem: 'polar',
        name: 'C',
        emphasis: {
            focus: 'series'
        }
    }],
    legend: {
        show: true
    }
};

setTimeout(function() {
    myChart.setOption({
        series: [{
        type: 'bar',
        data: [1],
        coordinateSystem: 'polar',
        name: 'A',
        emphasis: {
            focus: 'series'
        }
    }, {
        type: 'bar',
        data: [-2],
        coordinateSystem: 'polar',
        name: 'B',
        emphasis: {
            focus: 'series'
        }
    }, {
        type: 'bar',
        data: [-1],
        coordinateSystem: 'polar',
        name: 'C',
        emphasis: {
            focus: 'series'
        }
    }],
    })
}, 5000);

What is expected?

负值应该是0-负值 微信图片_20210409101951

What is actually happening?

在负值渲染后表现为,0-最大值-负值

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! 🍵

echarts-bot[bot] commented 3 years ago

@Wuli-Zhang It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** Negative value data rendering error under polar coordinates **BODY** ### Version 5.0.0 ### Steps to reproduce Initialize the polar chart and then display normal data, and when stoptoption is negative, the rendering direction does not change and is still rendering forward, resulting in an error in the display. ``` option = { angleAxis: { }, radiusAxis: { type: 'category', data: 'Monday', z: 10 }, polar: { }, series: [{ type: 'bar', data: [1], coordinateSystem: 'polar', name: 'A', emphasis: { focus: 'series' } }, { type: 'bar', data: [2], coordinateSystem: 'polar', name: 'B', emphasis: { focus: 'series' } }, { type: 'bar', data: [1], coordinateSystem: 'polar', name: 'C', emphasis: { focus: 'series' } }], legend: { show: true } }; setTimeout(function() { myChart.setOption({ series: [{ type: 'bar', data: [1], coordinateSystem: 'polar', name: 'A', emphasis: { focus: 'series' } }, { type: 'bar', data: [-2], coordinateSystem: 'polar', name: 'B', emphasis: { focus: 'series' } }, { type: 'bar', data: [-1], coordinateSystem: 'polar', name: 'C', emphasis: { focus: 'series' } }], }) }, 5000); ``` ### What is expected? The negative value should be 0-negative ! (WeChat Images: 20210409101951) (https://user-images.githubusercontent.com/25070589/114119715-c5689980-991d-11eb-92f2-50cf4bf29c21.png) ### What is actually happening? After a negative value is rendered, it appears as a 0-Max-negative value
Ovilia commented 3 years ago

15589 已修复,请更新到 5.2.1 及以上版本。