-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render linechart will crash when more times #52
Comments
is there some exception log ? |
10-27 23:09:21.858 15712-15762/com.myvictorytest A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x90cd005c in tid 15762 (mqt_js) |
how do you update your view? |
@hongyin163 i update the state per 1 seconds, the render will be run, wait for a moment, my app will crash on android...i am use the Galaxy S4, 5.0.1....My code look on the top. |
时间间隔设置长一点呢? |
The app will crash when states change more times. please help me, thanks.
getRandomData(){
var data={};
data['xValues']=[];
data['yValues']=[
{
data:[],
label:'test1',
config:{
color:'blue'
}
}
];
for (var i = 0; i < 50; i++) {
data.xValues.push(i+'');
data.yValues[0].data.push(Math.random()*100);
};
return data;
}
componentDidMount() {
var num=0;
setInterval(() => {
var datas=this.getRandomData();
this.setState({
randomDatas:datas
});
}, 1000);
}
render() {
return (
<LineChart
style={{flex:1}}
data={this.state.randomDatas}
visibleXRange={[0,30]}
maxVisibleValueCount={50}
xAxis={{drawGridLines:false,gridLineWidth:1,position:"BOTTOM"}}
yAxisRight={{enable:false}}
yAxis={{startAtZero:false,drawGridLines:false,position:"INSIDE_CHART"}}
drawGridBackground={false}
backgroundColor={"WHITE"}
description={""}
legend={{enable:true,position:'ABOVE_CHART_LEFT',direction:"LEFT_TO_RIGHT"}}
/>
);
}
The text was updated successfully, but these errors were encountered: