We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
`class Charts extends React.Component {
constructor(props) { super(props); this.state = { option: { title: { text: 'Step Line' }, tooltip: { trigger: 'axis' }, legend: { data:[ 'Step Middle'] }, grid: { left: '3%', right: '3%', bottom: '3%', containLabel: true }, toolbox: { }, xAxis: { type: 'category', data: [], splitLine: { show: true } }, yAxis: { type: 'value', splitLine: { show: false } }, series: [ { name:'Step Middle', type:'line', step: 'middle', data:[] } ] }, showChart: false, }; } componentWillMount () { this.getChartDatas(); } getChartDatas () { ajax({ api: 'orderGoodsChartsData', method: 'get', data: {}, withCredentials: true, crossOrigin: true }, suc => { if(suc.success != true){ Toast.error(suc.message || '获取图表信息异常'); }else{ let data = suc.data || {}, option = this.state.option; option.title = data.title; option.xAxis.data = data.jxch && data.jxch.date; option.series[0].data = data.jxch && data.jxch.out; this.setState({option: option, showChart: true}); } }, err => { Toast.error('获取图表信息异常'); }); } render () { console.log('option',this.state.option); if(this.state.showChart){ return ( <div> <ReactEcharts option={this.state.option} style={{height: '300px', width: '100%'}} lazyUpdate={true} theme={"theme_name"} onChartReady={() => { console.log('onChartReady'); }} onEvents={{ 'click': () => {console.log('clickCharts');} }} /> </div> ); } else{ return <div></div>; } }
}
export default Charts;`
The text was updated successfully, but these errors were encountered:
自己close了?解决了?
Sorry, something went wrong.
No branches or pull requests
`class Charts extends React.Component {
}
export default Charts;`
The text was updated successfully, but these errors were encountered: