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

Angle axis in polar axis not rendering negative values correctly #12109

Closed ThomasSteiner closed 4 years ago

ThomasSteiner commented 4 years ago

Version

4.6.0

Steps to reproduce

option = {
    angleAxis: {
        type: 'category',
        data: ['S1', 'S2', 'S3']
    },
    radiusAxis: {
        min:-1,
        max: 3

    },
    polar: {
    },
    series: [{
        type: 'bar',
        data: [1, 1, 1],
        coordinateSystem: 'polar',
        itemStyle:{
            color:"blue"

        },
        name: 'A',
        stack: 'a'
    }, {
        type: 'bar',
        data: [1, 1, 1],
        coordinateSystem: 'polar',
        name: 'B',
        stack: 'a'
    }, {
        type: 'bar',
        data: [1, 1, 1],
        coordinateSystem: 'polar',
        name: 'C',
        stack: 'a'
    }],
    legend: {
        show: true,
        data: ['A', 'B', 'C']
    }
};

What is expected?

Stack values should start at 0 and reflect correct values across the radius axis

What is actually happening?

Stack values resize and are forced to start at center of circle rather than 0 point of radius axis

echarts-bot[bot] commented 4 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 questions.

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

Have a nice day! 🍡

Ovilia commented 4 years ago

Thanks for reporting. This is a bug.

echarts-bot[bot] commented 4 years ago

This issue is labeled with difficulty: easy. @ThomasSteiner Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.

Please have a look at How to debug ECharts if you'd like to give a try. πŸ€“

sikazhang commented 4 years ago

I have located the problem at the file barPolar.js, it seems that the value of baseCoord is incorrect. based on the code, baseCoord = valueAxis.getExtent()[0]; Howerver I can't find out the correct variable to replace it. If anyone solves the problem, please @ me and give me a chance to learn, TX!

web3fans commented 4 years ago

This case I have modified the data [1,1,1]to [2,2,2],and change the radiusAxis.min to 1, and found that the view is wrong. This is my option:

option = {
    angleAxis: {
        type: 'category',
        data: ['S1', 'S2', 'S3']
    },
    radiusAxis: {
        min: 1,
        max: 6
    },
    polar: {
    },
    series: [{
        type: 'bar',
        data: [2, 2, 2],
        coordinateSystem: 'polar',
        itemStyle:{
            color:"blue"

        },
        name: 'A',
        stack: 'a'
    },
    {
        type: 'bar',
        data: [2, 2, 2],
        coordinateSystem: 'polar',
        name: 'B',
        stack: 'a'
    },
    {
        type: 'bar',
        data: [2, 2, 2],
        coordinateSystem: 'polar',
        name: 'C',
        stack: 'a'
    }],
    legend: {
        show: true,
        data: ['A', 'B', 'C']
    }
};

So I guess this ”minβ€œ do not support value except 0.