react-native-echarts-wrapper
react-native-echarts-wrapper copied to clipboard
Not working the tooltip issue(formatter) with the new version 2.0
Today, I upgraded the react-native-echarts-wrapper to v2.0. After I upgraded, the chart tooltip formatter is not working like the previous one.
tooltip: {
trigger: 'axis',
triggerOn: 'mousemove|click',
alwaysShowContent: true,
backgroundColor: COMP_COLOR,
padding: 10,
textStyle: {
color: '#fff',
},
formatter: function() {
return 'Product'
},
}
This is the code part I use.
Please let me know why "formatter" option is not working. Thanks
I am having the same issue. @tomLadder Any thoughts?
@Allwithyou999 @herzogpeter i will have a look at it
I don't think formatter is working at all, I could render the same way like this https://echarts.apache.org/examples/en/editor.html?c=bar-rich-text. check the icon on yAxis
@tomLadder any update now? I'm still facing this problem.
Comparing v2.0.0 and v1.3.1, I think the problem lies in jsBuilder.js line:6.
return new Function("return " + val.toString()); // v2.0.0
return val.toString(); // v1.3.1
This makes function
no longer included in result.
Any formatter/position/etc is working until next Option update. Easiest solution - reupdate Option with:
chart.setOption({
tooltip: {
formatter: params => {
return ...
}
}
});
I am having the same issue. @tomLadder Any thoughts?
I am having the same issue.