apache / echarts

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

[Bug] grid.top has no effect on sunburst chart #19288

Open AnotherCodeArtist opened 1 year ago

AnotherCodeArtist commented 1 year ago

Version

5.4.3

Link to Minimal Reproduction

https://codesandbox.io/s/cranky-leakey-5p3h5y?file=/src/index.js

Steps to Reproduce

  1. Define a sunburst chart
  2. Define a a title with text and subtext in the options object
  3. Set grid.top to any value

Current Behavior

The grid.top setting has no effect, which leads to an overlap of the title and the chart. In contrast to sunburst this works for bar and line charts and also sankey has an approach (a top property right in the series objects) to define a wider gap to the top.

Expected Behavior

When setting grid.top this should lead to a broader gap between the chart and the top of the container.

Environment

- OS: 14 Sonoma
- Browser: Safari / Firefox / Chrome
- Framework: ReactJS, echarts-for-react, echarts

Any additional comments?

No response

plainheart commented 1 year ago

Grid is only for the rectangular coordinate. In the sunburst series, you can use series.center option to adjust the position, for example, center: ['50%', 200].

AnotherCodeArtist commented 1 year ago

Yeah, but this serves the purpose only to a certain extend. series.center moves the sunburst chart but does not increase the container, thus, the lower part of the chart can easily become invisible, since it gets clipped by the border of the container. I need a solution that increases the gap between title and the actual chart. This works nice for those charts supporting grid but also for sankey, which has its own series.top property. What about introducing such a top property for sunburst as well? Or is there a combination of properties (something like height and center that might do the trick? Thanks for your pretty fast support!!

plainheart commented 12 months ago

Yeah. I think it makes sense to support these position options for sunburst series. Added it to the backlog.

Ovilia commented 12 months ago

@AnotherCodeArtist Can you explain what moves the sunburst chart but does not increase the container means? It seems to me that center and radius is enough for the situation. Please change the demo to let me understand it better. Thanks.