React native real time chart
I am facing some performance issues when trying to draw real-time chart using various libraries for data visualization in react native based mobile app. I tried multiple libraries like react native chart2, react-native-pathjs-charts, arty-charty etc. but all in vain. Is it React Native issue or just simple i could find right library ?
PS: I get data every 500 ms, 1000 ms, 2000 ms in my mobile app.
For example using, 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()
Comments
Post a Comment