echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Pie Chart Title textAlign 'center' not accurate

Open tztzt opened this issue 3 years ago • 2 comments

Version

5.2.0

Link to Minimal Reproduction

No response

Steps to Reproduce

I attempted to create a static title text in the center of the pie chart which is different from the data in the pie chart.

Using the below code on the website:

option = {
  title: {
    text: 'Progress',
    textStyle: {
      fontSize: '20px',
      paddingRight: '20px'
    },
    left: '20%',
    textAlign: 'center',
    top: 'center'
  },
  series: [
    {
      center: ['20%', '50%'],
      type: 'pie',
      data: [
        {
          value: 335,
          name: 'A'
        },
        {
          value: 234,
          name: 'B'
        }
      ],
      radius: ['40%', '70%']
    }
  ]
};

Current Behavior

image

The text center alignment does not match the center of the pie chart and the text appears slightly off center in the pie chart.

Expected Behavior

Text should be exactly placed in the middle of the pie chart.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

There is probably a correct way to do this that I am not getting, hope to get some help on this thanks!

No response

tztzt avatar Apr 28 '22 12:04 tztzt

Commenting to try to get some visibility on this issue

tztzt avatar May 19 '22 15:05 tztzt

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar May 18 '24 21:05 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar May 26 '24 21:05 github-actions[bot]