Browse Source

柱形图更新

master
luyisha 3 years ago
parent
commit
fe9725841f
  1. 34
      pages/home/home.vue

34
pages/home/home.vue

@ -235,6 +235,9 @@
},
renderChart(){
let yMax = ([...this.UpDownSta.data].sort())[this.UpDownSta.data.length-1];
if(!yMax){
yMax = 200;
}
let interval = yMax / 5;
// yMax = interval*6;
let option = {
@ -249,7 +252,9 @@
// },
grid: {
top: '12%',
bottom: '12%'
bottom: '12%',
left: '10%',
right: '5%'
},
tooltip: {},
xAxis: {
@ -261,11 +266,12 @@
max: yMax,
interval: interval
},
{
min: 0,
max: yMax,
interval: interval
}],
// {
// min: 0,
// max: yMax,
// interval: interval
// },
],
series: [
{
name: '',
@ -273,13 +279,13 @@
barMaxWidth: 30,
data: this.UpDownSta.data
},
{
name: '',
type: 'line',
// data: [175, 180, 410, 208, 195, 330],
data: this.UpDownSta.data,
yAxisIndex: 1
}
// {
// name: '',
// type: 'line',
// // data: [175, 180, 410, 208, 195, 330],
// data: this.UpDownSta.data,
// yAxisIndex: 1
// }
]
};
@ -376,7 +382,7 @@
API.request('/adminStatistics/upAndDownStatistics', {type: type}, res=>{
this.UpDownSta = res.data;
this.UpDownSta.xData = this.UpDownSta.histogram.map(item=>{
return item.date;
return +item.date+'月';
})
this.UpDownSta.data = this.UpDownSta.histogram.map(item=>{
return item.value;

Loading…
Cancel
Save