apache / apache/echarts

[Bug] Load SVG but radialGradient not work

Open
#18,407 7 comments 0 reactions 1 assignee Claimed by @plainheart View on GitHub
enhancement SVG
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.4.1

### Link to Minimal Reproduction

_No response_

### Steps to Reproduce

I am using echarts to load SVG , but radialGradient not work.

![image](https://user-images.githubusercontent.com/29109418/226829173-23e608ad-6bb4-48b5-a912-d1123e0a0162.png)



var dom = document.getElementById('container');
var myChart = echarts.init(dom, null, {
renderer: 'canvas',
useDirtyRect: false
});
var app = {};
var option;

$.get('./a.svg', function (svg) {
echarts.registerMap('flight-seats', { svg: svg });
option = {
tooltip: {},
geo: {
map: 'flight-seats',
roam: true,
selectedMode: 'multiple',
layoutCenter: ['50%', '50%'],
layoutSize: '100%',
tooltip: {
show: true
},
itemStyle: {
color: '#fff'
},
emphasis: {
itemStyle: {
color: undefined,
borderColor: 'green',
borderWidth: 2
},
label: {
show: false
}
},
select: {
itemStyle: {
color: 'green'
},
label: {
show: false,
textBorderColor: '#fff',
textBorderWidth: 2
}
}
}
};

myChart.setOption(option);
});

if (option && typeof option === 'object') {
myChart.setOption(option);
}

window.addEventListener('resize', myChart.resize);

### Current Behavior

I am using echarts to load SVG , but radialGradient not work.

### Expected Behavior

Make radialGradient working.

### Environment

```markdown
- OS:
- Browser:
- Framework:
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.