echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] 旭日图label文字沿着弧线分布

Open sentimental114 opened this issue 1 year ago • 5 comments

What problem does this feature solve?

旭日图中,名称稍长,按照原先label沿着固定方向直线排列的方式,可能会很突兀。而沿着弧线会使整体看起来更和谐,并且也能容纳更多的文字。之前貌似也有人需求该功能,可惜的是当时并不能满足,不知现在能否实现。

What does the proposed API look like?

在旭日图的label配置中添加一个是否沿弧线排列即可。

sentimental114 avatar Aug 23 '24 10:08 sentimental114

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

TRANSLATED

TITLE

The Rising Sun Chart label text is distributed along an arc

BODY

What problem does this feature solve?

In the sunburst chart, the name is slightly longer, and it may be very abrupt according to the original way of arranging the labels in a straight line along a fixed direction. Following the arc will make the whole look more harmonious and can also accommodate more text. It seems that some people have requested this function before, but unfortunately it was not satisfied at the time. I wonder if it can be implemented now.

What does the proposed API look like?

Just add whether to arrange along the arc in the label configuration of the sunburst chart.

echarts-bot[bot] avatar Aug 23 '24 10:08 echarts-bot[bot]

Canvas/SVG don't have methods to render text along a path so I'm afraid such a feature would be hard to implement.

Ovilia avatar Aug 26 '24 07:08 Ovilia

Canvas/Svg seems to have a textPath attribute. Can we reserve an API to define this textPath, so that the text can be distributed along the curved edge of the rising sun chart(sunburst)

sentimental114 avatar Aug 26 '24 08:08 sentimental114

You are welcomed to make a pull request to https://github.com/ecomfe/zrender

Ovilia avatar Aug 27 '24 10:08 Ovilia

Okay I'll give it a try

sentimental114 avatar Aug 27 '24 11:08 sentimental114

Now, using rich text on labels, setting an arc-shaped font image as the background can also be achieved, but it is still too cumbersome because not only do we need to gradually confirm the position of the image, but we also need to set separate rules for each layer. For this reason, many levels of interaction have also been removed. I still hope to add this feature in the future

sentimental114 avatar Aug 30 '24 07:08 sentimental114