You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -107,7 +110,6 @@ the `class` of echarts div. you can setting the css style of charts by class nam
107
110
108
111
the `theme` of echarts. `string`, should `registerTheme` before use it (theme object format: [https://github.com/ecomfe/echarts/blob/master/theme/dark.js](https://github.com/ecomfe/echarts/blob/master/theme/dark.js)). e.g.
109
112
110
-
111
113
```js
112
114
// import echarts
113
115
importechartsfrom'echarts';
@@ -154,6 +156,18 @@ let onEvents = {
154
156
```
155
157
for more event key name, see: [http://echarts.baidu.com/api.html#events](http://echarts.baidu.com/api.html#events)
156
158
159
+
-**`opts`** (optional, object)
160
+
161
+
the `opts` of echarts. `object`, will be used when initial echarts instance by `echarts.init`. Document [here](http://echarts.baidu.com/api.html#echarts.init).
162
+
163
+
```js
164
+
<ReactEcharts
165
+
option={this.getOption()}
166
+
style={{height:'300px'}}
167
+
opts={{renderer:'svg'}} // use svg to render the chart.
168
+
/>
169
+
```
170
+
157
171
158
172
# 4. Component API & Echarts API
159
173
@@ -185,7 +199,23 @@ You can use the API to do:
185
199
4.`release` the charts.
186
200
187
201
188
-
# 5. LICENSE
202
+
# 5. Q & A
203
+
204
+
- How to render the chart with svg when using echarts 4.x
205
+
206
+
Use the props `opts` of component with `renderer = 'svg'`. For example:
207
+
208
+
209
+
```js
210
+
<ReactEcharts
211
+
option={this.getOption()}
212
+
style={{height:'300px'}}
213
+
opts={{renderer:'svg'}} // use svg to render the chart.
0 commit comments