|
@@ -164,14 +164,14 @@ Page({
|
|
|
|
|
|
imagewidth: 0,//缩放后的宽
|
|
|
imageheight: 0,//缩放后的高
|
|
|
- chartData:{
|
|
|
- actual:[552,586,3555,4454,552,556,4455],
|
|
|
- prediction:[552,546,3585,4424,542,546,35,44,524,56,355,444,2224,421],
|
|
|
- timeData : [
|
|
|
- '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7', '2020/6/8', '2020/6/9', '2020/6/10','2020/6/11',
|
|
|
- '2020/6/12','2020/6/13','2020/6/14',
|
|
|
- ]
|
|
|
- },
|
|
|
+ // chartData:{
|
|
|
+ // actual:[552,586,3555,4454,552,556,4455],
|
|
|
+ // prediction:[552,546,3585,4424,542,546,35,44,524,56,355,444,2224,421],
|
|
|
+ // timeData : [
|
|
|
+ // '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7', '2020/6/8', '2020/6/9', '2020/6/10','2020/6/11',
|
|
|
+ // '2020/6/12','2020/6/13','2020/6/14',
|
|
|
+ // ]
|
|
|
+ // },
|
|
|
chartDatas:{
|
|
|
actual:[572,556,3555,4744,552,576,3555],
|
|
|
prediction:[352,246,385,2424,542,546,255],
|
|
@@ -323,13 +323,25 @@ Page({
|
|
|
apiServer.getHushen().then((res) =>{
|
|
|
if(res.statusCode == 200){
|
|
|
console.log(res);
|
|
|
-
|
|
|
- this.setData({
|
|
|
-
|
|
|
+ this.setData({
|
|
|
+ chartDatas:this.recursion(res.data.data),
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ recursion:function(row,a=[],b=[],c=[],d){
|
|
|
+ for(let i in row.actuals){
|
|
|
+ a.unshift(row.actuals[i].industryDate)
|
|
|
+ b.unshift(row.actuals[i].close)
|
|
|
+ c.unshift(row.actuals[i].pred)
|
|
|
+ }
|
|
|
+ if(row.tag){
|
|
|
+ d="#D81E06"
|
|
|
+ }else{
|
|
|
+ d="#07c160"
|
|
|
+ }
|
|
|
+ return {"timeData":a,"actual":b,"prediction":c,"color":d}
|
|
|
+ },
|
|
|
onReady: function (e) {
|
|
|
this.computeScrollViewHeight();
|
|
|
// var query = wx.createSelectorQuery()
|