up

parent 8d7b07e2
...@@ -60,35 +60,35 @@ class App extends Component { ...@@ -60,35 +60,35 @@ class App extends Component {
allLinksArr = Links allLinksArr = Links
// console.log(Rows, TopAxisX, BottomAxisX, Links) // console.log(Rows, TopAxisX, BottomAxisX, Links)
that.initChart(resData) that.initChart(resData)
that.interval = setInterval(() => { // that.interval = setInterval(() => {
fetch(`/api/graph_by_height_and_duration?height=0&duration=${that.state.requestDuration}`,{ // fetch(`/api/graph_by_height_and_duration?height=0&duration=${that.state.requestDuration}`,{
method:'GET', // method:'GET',
headers:{ // headers:{
'Content-Type':'application/json;charset=UTF-8' // 'Content-Type':'application/json;charset=UTF-8'
}, // },
}) // })
.then(res =>res.json()) // .then(res =>res.json())
.then((newData) => { // .then((newData) => {
let {Rows, AxisX, Links } = newData.result // let {Rows, AxisX, Links } = newData.result
let {TopAxisX, BottomAxisX} = AxisX // let {TopAxisX, BottomAxisX} = AxisX
allRows0Arr = Rows[0] // allRows0Arr = Rows[0]
allRows1Arr = Rows[1] // allRows1Arr = Rows[1]
allRows2Arr = Rows[2] // allRows2Arr = Rows[2]
allTopAxisXArr = TopAxisX // allTopAxisXArr = TopAxisX
allBottomAxisXArr = BottomAxisX // allBottomAxisXArr = BottomAxisX
allLinksArr = Links // allLinksArr = Links
newData.result.Rows[0] = allRows0Arr // newData.result.Rows[0] = allRows0Arr
newData.result.Rows[1] = allRows1Arr // newData.result.Rows[1] = allRows1Arr
newData.result.Rows[2] = allRows2Arr // newData.result.Rows[2] = allRows2Arr
newData.result.AxisX.TopAxisX = allTopAxisXArr // newData.result.AxisX.TopAxisX = allTopAxisXArr
newData.result.AxisX.BottomAxisX = allBottomAxisXArr // newData.result.AxisX.BottomAxisX = allBottomAxisXArr
newData.result.Links = allLinksArr // newData.result.Links = allLinksArr
that.initChart(newData) // that.initChart(newData)
}) // })
}, 5000); // }, 5000);
var chartDom = document.getElementById('main'); var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
myChart.on('datazoom', function(params){ myChart.on('datazoom', function(params){
...@@ -615,8 +615,8 @@ class App extends Component { ...@@ -615,8 +615,8 @@ class App extends Component {
<div id="main" className="container" style={{position:'relative', padding: '50px', boxSizing:'border-box', width: '100%', height: 900 }}> <div id="main" className="container" style={{position:'relative', padding: '50px', boxSizing:'border-box', width: '100%', height: 900 }}>
</div> </div>
<div style={{position:'absolute',left:'1%',top:'70%',fontSize:'12px'}}>{startText}</div> <div style={{position:'absolute',left:'1%',top:'70%',fontSize:'12px',color:'#80828a'}}>{startText}</div>
<div style={{position:'absolute',right:'5%',top:'70%',fontSize:'12px'}}>{endText}</div> <div style={{position:'absolute',right:'5%',top:'70%',fontSize:'12px',color:'#80828a'}}>{endText}</div>
</div> </div>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment