Skip to content

[Bug]极坐标柱状图半径多次改变后报错 #16731

@wojiaohanshuai

Description

@wojiaohanshuai

Version

5.3.1

Link to Minimal Reproduction

No response

Steps to Reproduce

i download the demo code from official demo page https://echarts.apache.org/examples/zh/editor.html?c=bar-polar-label-tangential , add a little code and open in chrome

code as below:

    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};

    var option;



    option = {
      title: [
        {
          text: 'Tangential Polar Bar Label Position (middle)'
        }
      ],
      polar: {
        radius: [30, '80%']
      },
      angleAxis: {
        max: 4,
        startAngle: 75
      },
      radiusAxis: {
        type: 'category',
        data: ['a', 'b', 'c', 'd'],
        // 在demo基础上加的
        splitLine: {
          show: true,
          lineStyle: {
            color: "RGB(98, 114, 136)",
            width: 1,
            type: "dashed"
          }
        }
      },
      series: {
        type: 'bar',
        data: [2, 1.2, 2.4, 3.6],
        coordinateSystem: 'polar',
        label: {
          show: true,
          position: 'middle',
          formatter: '{b}: {c}'
        }
      }
    };

    if (option && typeof option === 'object') {
      myChart.setOption(option);
    }

    // 在demo基础上加的
    setInterval(() => {
      myChart.setOption({
        ...option,
        "polar": {
          radius: `${(Math.random() * 100).toFixed(2)}%`
        },
      });
    }, 400);

Current Behavior

截屏2022-03-23 21 56 26

Expected Behavior

set radiusAxis.splitLine.show = true;
and i can change polar.radius multi times

Environment

- OS:macOS Monterey
- Browser: chrome 99.0.4844.74
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions