【发布时间】:2017-11-24 08:40:51
【问题描述】:
if(this.state.chartCategory == 'D3Chart'){
console.log("chartdata for d3 charts", this.state.d3line.chartData);
switch(this.state.chartType){
case 'area': return <div style={{width: 900, height:300}}><Areagraph data = {this.state.d3line.chartData} vars = {{x: this.state.d3line.x, y: this.state.d3line.y}} dispatch = {this.showFilter} title = {this.state.data.chartName}/></div>;
case 'pie': return <div style={{width: 900, height:500}}><Piegraph data = {this.state.d3line.chartData} vars = {{x: this.state.d3line.x, y: this.state.d3line.y}} dispatch = {this.showFilter} title = {this.state.data.chartName}/></div>;
case 'bar': return <div style={{width: 900, height:300}}><Bargraph data = {this.state.d3line.chartData} vars = {{x: this.state.d3line.x, y: this.state.d3line.y}} dispatch = {this.showFilter} title = {this.state.data.chartName}/></div>;
/*case 'column': return <div className = "graphContainer" style={{width: 900, height:300, overflow: "hidden", resize: "both", paddingBottom: "10px", border: "1px solid black"}}><Columngraph data = {this.state.d3line.chartData} vars = {{x: this.state.d3line.x, y: this.state.d3line.y}} dispatch = {this.showFilter} title = {this.state.data.chartName}/></div>;*/
case 'line' : return <div style={{width: 900, height:300}}><Linegraph data = {this.state.d3line.chartData} vars = {{x:this.state.d3line.x, y: this.state.d3line.y, group: this.state.d3line.x}} dispatch = {this.showFilter} title = {this.state.data.chartName}/></div>;
default: return null;
}
}
在控制台中,我正在打印要从字符串转换为整数的数据If number, convert string to integer, number also taking as string, How to convert into number need to remove " "
如果你签入我需要转换的图片,如果是单独的数字
【问题讨论】:
-
看看here
标签: javascript reactjs