Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] In SVG rendering mode, ECharts does not support gradient colors for axis line styling. #19726

Open
BrazilAmando opened this issue Mar 17, 2024 · 2 comments
Labels
bug en This issue is in English SVG
Milestone

Comments

@BrazilAmando
Copy link

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=line-simple&lang=js&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqM2gHUqAlXIAWClQDEOEFQGVmphdFoBdPqViNceADIRoNVPfQAbN1RMU3h78XvTA3pwEnl72FNQEtL7ujBy8ITEYBAAMdjGk5Nm5eZgATAQAjEV55GU56aHhnAGghKL1MUiwwABm3XhUYIVhERwJHBq0AL5VxUg9fQPZAHQArDzDkbTjmtPtXnO9_YNZq-uNo7QARt6M9ADWU9Z7u8UA7hACYNoVWfWTIf90C9YOQcPgiNF0HEaLIAG6MbxKWgkYH9IxUQiwNr2SGkIRgERY8orHKwEoAZlJJRKABYeGTygAOenlclrWDlGkAdnpJQAbFlbPVoXQksoASQnpMANxAA

Steps to Reproduce

xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisLine:{
lineStyle:{
color:{
type:'linear',
x:0,
y:0,
x2:1,
y2:0,
colorStops:[
{ offset:0,color:'red'},
{offset:0.5,color:'red'},
{offset:0.5,color:'black'}]
},
width:10
}
}
},

Current Behavior

When configured to use SVG rendering mode, ECharts does not support gradient colors for axis line styling. This limitation is not present in Canvas rendering mode.
image

Expected Behavior

gradient colors work well in SVG rendering mode.

Environment

- OS:windows11
- Browser:chrome
- Framework:

Any additional comments?

No response

@plainheart
Copy link
Member

This may be similar to ecomfe/zrender#792. It's dut to the objectBoundingBox pattern unit. See also https://stackoverflow.com/questions/21638169/svg-line-with-gradient-stroke-wont-display-if-vertical-or-horizontal.

@plainheart plainheart added the SVG label Mar 18, 2024
@plainheart plainheart added this to the TBD milestone Mar 18, 2024
@plainheart
Copy link
Member

As a workaround, you may refer to this demo.

@plainheart plainheart added the en This issue is in English label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English SVG
Projects
None yet
Development

No branches or pull requests

2 participants