Version
5.5.0
Link to Minimal Reproduction
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.
Expected Behavior
gradient colors work well in SVG rendering mode.
Environment
- OS:windows11
- Browser:chrome
- Framework:
Any additional comments?
No response
2条答案
按热度按时间ma8fv8wu1#
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 .ipakzgxi2#
As a workaround, you may refer to this demo .