Comments (17)
我通过 将 react-native-skia 升级至 0.1.216 版本,并通过 自定义字体解决了中文乱码问题, 目前在 华为平板、oneplus、oppo 上测试没问题
from react-native-echarts.
Yes, we found this problem too, let me think about how to fix it.
from react-native-echarts.
There's no good way to fix it yet, in your scenario, with a temporary patch.
// fix: https://github.com/react-native-svg/react-native-svg/issues/983
if (Platform.OS === 'android' && attrs.clipPath && !attrs.clipRule) {
const allChildrenIsLine = children?.every((child) => {
const d = child.attrs.d?.toString() || '';
return (
child.tag === 'path' &&
child.attrs.fill === 'none' &&
d[d.length - 1] !== 'Z'
);
});
if (allChildrenIsLine) {
attrs.clipRule = 'nonzero';
}
}
Also skia has better performance when tested and is more recommended.
from react-native-echarts.
If there is no more suitable method, this patch will be adopted soon.
from react-native-echarts.
Also have this problem when the legend's orient is set to vertical?
legend: {
type: 'scroll',
orient: 'vertical',
right: 10,
top: 20,
bottom: 20,
data: data.legendData
},
from react-native-echarts.
Try commenting out this code to see if this is the effect here:
lib/module/svgChart.js
// fix: https://github.com/react-native-svg/react-native-svg/issues/983
if (attrs.clipPath && !attrs.clipRule && Platform.OS === 'android') {
attrs.clipRule = 'nonzero';
}
from react-native-echarts.
Hi @zhiqingchen,
- Changing the orientation to vertical does show them vertically but there is no scrolling functionality then and it acquires a lot of space as well which is not adequate for our needs.
- I tried out your suggestion and commented the code you specified. On commenting the code, the legend is shown properly at first. But the line graph disappears from the chart and once I press the arrow to scroll to the right, the legend disappears completely then and doesn't reappear at any stage.
from react-native-echarts.
Hi @zhiqingchen, the temporary patch that you suggested seems to work as expected. As you're now aware of the issue, are you planning to put this patch or a different permanent fix in the next release? Thanks :)
from react-native-echarts.
@iambool 1.2.2-alpha.3
from react-native-echarts.
我更换了用Skia来渲染,然后遇到中文乱码的问题,然后寻找中文乱码的解决方法,提示用SVG渲染或设置字体,然后我去设置字体,在安卓上感觉没效果呀
from react-native-echarts.
https://github.com/wuba/taro-playground/blob/main/src/pages/explore/charts/pages/bar/mixTimelineFinance.tsx
- 尝试将依赖,升级到最新版
- 可能有某些系统/机型不支持,未全面验证过
from react-native-echarts.
我设置了下全局的字体 ,现在使用的是Skia渲染, ios上一切正常,在安卓上好像不生效,还是乱码,但是使用SVG渲染就可以,我不知道我的代码哪里写的有问题 ,我还需要做哪些修改才可以呢 亲亲
{
series:[
{
type:'bar',
showBackground:false,
data: array.map((item) => item.count),
barWidth: 22,
axisTick: {
alignWithLabel: true
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#2378f7' },
{ offset: 0.7, color: '#2378f7' },
{ offset: 1, color: '#83bff6' }
]),
borderType:'dashed',
borderRadius: [2, 2, 0, 0]
},
label:{
show:true,
fontSize:8
}
}
],
tooltip: {
trigger: 'axis',
showDelay: 0,
show: true,
axisPointer: {
type: 'shadow',
shadowStyle: {
color: 'rgba(247, 54, 93, 0.04)',
width: '1',
},
},
backgroundColor: 'rgba(0,0,0,0.7)',
formatter: function (params) {
// onChange(params,array)
return params[0].name + ': ' + params[0].value;
},
borderWidth: 0,
extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0);',
textStyle: {
color: '#fff',
}
},
yAxis: {
type: 'value',
show:false
},
xAxis: {
type: 'category',
data: array.map((item) => item.showTime),
axisLine :{
lineStyle:{
color:'#888',
}
},
nameLocation:'start',
nameTextStyle:{
color:'#888',
fontSize:8,
},
axisTick:{
show:false
},
axisLabel:{
color:'#888',
fontSize:8,
}
},
textStyle:{
fontFamily:'monospace'
}
}
from react-native-echarts.
我用你提供的示例的代码,放到我的项目里允许也是乱码
from react-native-echarts.
Is there any fix available now?
from react-native-echarts.
@zhiqingchen Is that patch available now in 1.2.3?
from react-native-echarts.
@zhiqingchen Is that patch available now in 1.2.3?
no, it's not final solution.
from react-native-echarts.
我通过 将 react-native-skia 升级至 0.1.216 版本,并通过 自定义字体解决了中文乱码问题, 目前在 华为平板、oneplus、oppo 上测试没问题
@xSmile-art 你使用的是什么字体?
from react-native-echarts.
Related Issues (20)
- Please support Korean in the library! HOT 2
- [Help] How to setting chart container size the right way ? HOT 5
- Unable to use SVG in markline label.formatter
- 类组件中怎么使用 HOT 2
- Is there any way to create Table or Grid chart using this library? HOT 3
- Tooltip formatter neglects all other options HOT 2
- visualMap and ZoomDataComponent wrong working together ? HOT 2
- Visual of graph breaks when changing from having data to none HOT 13
- Strange "shaking" behaviour for coordinateSystem + roundCap bar charts for higher than 100% percent values HOT 1
- Problem with markLine not being displayed HOT 5
- Unexpected token 'export': ´export * from './lib/module/svgChart'´ when using Next.js & Expo in monorepo HOT 5
- animation not work HOT 2
- Unable to re-render on Tablet device orientation change with new height and width HOT 3
- SkiaChart Android 手机中文乱码 HOT 1
- Setting data as dataset is not working HOT 5
- TypeError: Cannot read property 'trigger' of null, js engine: hermes HOT 5
- When rendering multiple charts simultaneously, the animation may experience lag(dropped frames) HOT 3
- ios Crash HOT 1
- Some tooltip options don't work on the `richText` render mode
- Sync prop changes HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-echarts.