在尝试使用各种库在基于反应原生的移动应用程序中进行数据可视化绘制实时图表时,我遇到了一些性能问题。 我尝试了多个库,如反应原生图表2,react-native-pathjs-charts,arty-charty等,但都是徒劳的。它是React Native问题还是简单的我能找到合适的库?
PS:我在移动应用程序中每500毫秒,1000毫秒,2000毫秒获取数据。
例如使用react-native-chart2
//In Render function, i have below source
<RNChart style={styles.rnchart}
chartData={chartData}
verticalGridStep={50}
gridColor={'white'}
labelTextColor={"white"}
showYAxisLabels={false}
xLabels={xAxisTime}/>
//In data receive event callback, i have below source
let newArr1 = yAxisDataArr.slice(sliceFrom);
newArr1.push(currntMa);
newArr1.push(currntMa/4);
yAxisDataArr = newArr1;
chartData = [
{
name:'LineChart',
//color:'gray',
lineWidth:2,
showDataPoint:false,
data:yAxisDataArr
}
];
this._tick()