react-native-echarts: SkiaChart: Texts including axis labels, tooltips, toolbox and legend are not rendered.
Describe the bug Texts including axis labels, tooltips, toolbox and legend are not rendered.
To Reproduce Steps to reproduce the behaviour:
- Try a minimal example using SkiaChart with the below library versions.
"@wuba/react-native-echarts": "^1.3.1",
"@shopify/react-native-skia": "^0.1.241",
"echarts": "^5.5.0",
"react": "18.2.0",
"react-native": "^0.73.4",
Expected behaviour Texts on axis labels, tooltips, legends and toolbox should be visible.
Screenshots
This is how it looks like when it is rendered using SkiaChart
This is how it is expected to look (screenshot taken after rendered using SVG)
Desktop (please complete the following information):
- OS: Ubuntu
- Browser: N/A
- Version: 22.04.4
Smartphone (please complete the following information):
- Device: Samsung A12
- OS: Android 13
- Browser: N/A
- Version: N/A
Additional context Sample code: Github gist
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 1
- Comments: 35 (13 by maintainers)
https://wuba.github.io/react-native-echarts/docs/migration/v2
@Jay2009 Below is what we’ve done as a workaround for now. It’s not ideal but might help you (as long as you don’t need react-native-skia for anything bar react-native-echarts on iOS).
@shopify/react-native-skia 0.1.234 is the last version that will render text in react-native-echarts. That version will crash/lock up an iOS app on RN 0.73.8 (the version of RN we’re using, I haven’t tried 0.74.x yet) but seems to work fine on Android. We want Skia rendering for slow Android devices as it’s faster than SVG rendering. The iOS devices will use SVG rendering for now (since they have generally stronger performance).
How to set this up:
package.json.react-native.config.js(there’s no point linking it if we can’t use it):SkiaChartorSvgChartdepending on platform:I am working on the 2.x branch, and there has been some progress, but there is still a lot of work to be done.
If you are interested, please review the code and provide me with some feedback.
Rendered by skia above and rendered by svg below, skia also supports shadow, which is a nice feature.
yes, and expo snacks are ready too.
try this demo @ducpt-bili https://github.com/zhiqingchen/react-native-echarts-test
try 2.0.0-canary.3
https://github.com/wuba/react-native-echarts/pull/193 Related discussion moved to this PR, your previous feedback question we have not repeated.https://github.com/user-attachments/assets/c3ab96f8-3320-4406-9699-cdd9bb02005a
Yeah, I mean the whole reason I chose echarts over victory was for performance with skia. If I’m back down to svg anyways I’m not sure what the win is. Naturally I cannot downgrade RN, if anything I need to upgrade RN. I’m optimistic that zhiqingchen will have a solution soon. I’m tentatively using svg renderer until then.
dev version 2.0.0-canary.0
sample code https://github.com/wuba/react-native-echarts/blob/2.x/example/src/App.tsx
@ducpt-bili
We can’t use it until we do a big refactoring, or
@hthieu1110
Now that react-native-skia have documented that text in ImageSVG tags is not going to be supported could we add that to the known issues on https://github.com/wuba/react-native-echarts/issues/16?
@nipunadodan yes I am having exactly same issue with you. so any solution yet?
Yes, I’m aware. SvgCharts works but it’s slow to respond to gestures. That’s why I explicitly need SkiaChart to work.
https://github.com/wuba/react-native-echarts/issues/16 @AlejandroRM-DEV
use rnsvg or lower version of rnskia