Closed congshengwu closed 1 year ago
This PR supports parsing the arrow function in string format for the Echarts option, an enhancement for PR #91.
// Echarts option const option = { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], axisLabel: { interval: 0, formatter: `(value, index) => { return value + '(' + index + ')'; }`, }, }, yAxis: { type: 'value', axisLabel: { formatter: `(value) => { return formatterVariable.currency + value; }`, textStyle: { color: `function(value) { return value >= 200 ? 'green' : 'red'; }`, }, }, }, series: [ { data: [150, 230, 224, 218, 135, 147, 260], type: 'line', }, ], }; // Echarts view <RNEChartsPro style={{width: Dimensions.get('window').width}} option={option} formatterVariable={{currency: '¥'}} enableParseStringFunction />
这种方法,debug环境,图表不显示
Summary
This PR supports parsing the arrow function in string format for the Echarts option, an enhancement for PR #91.
Test Plan
Code:
Running result: