echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] 自定义图形path中支持使用marker

Open BrazilAmando opened this issue 1 year ago • 3 comments

What problem does this feature solve?

当前版本的echarts似乎并不支持SVG中的marker元素使用,在绘制某些特定图形时比较麻烦,如添加箭头等

What does the proposed API look like?

在renderItem 返回的path元素的style中,添加一个defs属性: {type:'path', shape:{d:'M0,0 h100'}, style:{ defs:[ { marker:{id:'arrow',markerHeight:10,markerWidth:10,refX:5,refY:5, type:'circle', shape:{cx:0,cy:0,r:5},style:{fill:'red',stroke:'black'}}}}

BrazilAmando avatar Apr 13 '24 01:04 BrazilAmando

@BrazilAmando 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

[Feature] Marker is supported in custom graph paths

BODY

What problem does this feature solve?

The current version of echarts does not seem to support the use of marker elements in SVG, which is more troublesome when drawing certain graphics, such as adding arrows, etc.

What does the proposed API look like?

In the style of the path element returned by renderItem, add a defs attribute: {type:'path', shape:{d:'M0,0 h100'}, style:{ defs:[ { marker:{id:'arrow',markerHeight:10,markerWidth:10,refX:5,refY:5, type:'circle', shape:{cx:0,cy:0,r:5},style: {fill:'red',stroke:'black'}}}}

echarts-bot[bot] avatar Apr 13 '24 01:04 echarts-bot[bot]

graphic.elements is an underlying API to drawing custom objects, so it doesn't provide the ability of drawing symbles as you suggested. You could consider using image instead.

Ovilia avatar Apr 15 '24 06:04 Ovilia

echarts does not seem to support the use of marker elements in SVG

markPoint can display SVG thru image:// - Demo

helgasoft avatar Apr 16 '24 19:04 helgasoft