|
@@ -12,6 +12,9 @@ import config from "@config";
|
|
|
class ChartItem extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
+ this.state={
|
|
|
+ timeDismen:props.timeTypes
|
|
|
+ };
|
|
|
this.getContainers = this.getContainers.bind(this);
|
|
|
this.rangChange = this.rangChange.bind(this);
|
|
|
this.getXAxisArr = this.getXAxisArr.bind(this);
|
|
@@ -71,10 +74,14 @@ class ChartItem extends Component {
|
|
|
const {initFn} = this.props;
|
|
|
const times = this.getXAxisArr(type);
|
|
|
const range = [times[0],times[times.length-1]];
|
|
|
+ const temp=this.state.timeDismen;
|
|
|
+ this.setState({
|
|
|
+ timeDismen:Object.assign(temp,{[index]:type})
|
|
|
+ });
|
|
|
initFn&&initFn({range,rangeType:type,index});
|
|
|
}
|
|
|
getContainers(){
|
|
|
- const {timeTypes} = this.props;
|
|
|
+ const timeTypes = this.state.timeDismen;
|
|
|
const range = this.getXAxisArr(config.chartDismen);
|
|
|
const obj = this.props.data[range[0]+range[range.length-1]];
|
|
|
let arr = [];
|