Migrate from v1 to v2
Key Changes
- SVGRenderer and SkiaRenderer are now split.
- SkiaChart refactored, no more
ImageSVG
tag. - Added support for new rendering effects (e.g., shadows).
Steps to Migrate from v1 to v2
SVGChart has no changes, so you can skip this migration if you are using SVGChart.
Summary
- Replace SVGRenderer with SkiaRenderer.
- Set
renderer: 'skia'
when initializing the chart.
1. Update Imports
v1
import { SVGRenderer, SkiaChart } from '@wuba/react-native-echarts';
echarts.use([SVGRenderer]);
v2
import { SkiaRenderer, SkiaChart } from '@wuba/react-native-echarts';
echarts.use([SkiaRenderer]);
2. Initialize Chart with SkiaRenderer
v1
chart = echarts.init(skiaRef.current, 'light', {
renderer: 'svg',
});
v2
chart = echarts.init(skiaRef.current, 'light', {
renderer: 'skia',
});