...
|
...
|
@@ -378,7 +378,23 @@ export default { |
|
|
},
|
|
|
splitLine: {
|
|
|
show: false,
|
|
|
}
|
|
|
},
|
|
|
/* min:function (value){
|
|
|
if(Math.abs(value.max)>Math.abs(value.min)){
|
|
|
return (-Math.abs(value.max)*1.2).toFixed(2)
|
|
|
}else{
|
|
|
return (-Math.abs(value.min)*1.2).toFixed(2)
|
|
|
|
|
|
}
|
|
|
},
|
|
|
max:function (value){
|
|
|
if(Math.abs(value.max)>Math.abs(value.min)){
|
|
|
return (Math.abs(value.max)*1.2).toFixed(2)
|
|
|
}else{
|
|
|
return (Math.abs(value.min)*1.2).toFixed(2)
|
|
|
|
|
|
}
|
|
|
}*/
|
|
|
},
|
|
|
{
|
|
|
type: "value",
|
...
|
...
|
@@ -627,19 +643,21 @@ export default { |
|
|
dataView: {
|
|
|
show: true, title: '数据视图', readOnly: true, optionToContent: function (opt) {
|
|
|
let series = opt.series;
|
|
|
console.log("***",opt)
|
|
|
let str='';
|
|
|
if(that.optionsSetup.download){
|
|
|
str+=`<div style="position: absolute;right: 10px;top: 6px;color:#1e9fff;cursor: pointer;">
|
|
|
<span id="handleButton" >导出</span>
|
|
|
</div>`;
|
|
|
}
|
|
|
let table =str+ '<table '+that.dataViewTable+' class="dataViewTable"><thead><tr class="dataViewTr">';
|
|
|
let table =str+ '<table '+that.dataViewTable+' class="dataViewTable"><thead>' +
|
|
|
'<tr class="dataViewTr"><td '+that.dataViewThead+'>日期</td>';
|
|
|
for(let i=0;i<series.length;i++){
|
|
|
table+='<td '+that.dataViewThead+' class="dataViewHead">' + (series[i].name?series[i].name:'') + '</td>';
|
|
|
}
|
|
|
table+= '</thead></tr><tbody '+that.dataViewTbody+'>';
|
|
|
for(let j=0;j<series[0].data.length;j++){
|
|
|
table += '<tr class="dataViewTr">';
|
|
|
table += '<tr class="dataViewTr"><td '+that.dataViewTd+'>'+opt.xAxis[0].data[j]+'</td>';
|
|
|
for(let i=0;i<series.length;i++){
|
|
|
table +='<td '+that.dataViewTd+' class="dataViewTd">' + series[i].data[j] + '</td>'
|
|
|
}
|
...
|
...
|
@@ -770,15 +788,15 @@ export default { |
|
|
})
|
|
|
}
|
|
|
this.options.series=series;
|
|
|
let arr=[];
|
|
|
this.options.series.map(item=>{
|
|
|
arr.push(item.data)
|
|
|
})
|
|
|
let min=this.calMin(arr);
|
|
|
let max=this.calMax(arr);
|
|
|
if(min<0){
|
|
|
this.options.yAxis[1].min=-20;
|
|
|
}
|
|
|
// let arr=[];
|
|
|
// this.options.series.map(item=>{
|
|
|
// arr.push(item.data)
|
|
|
// })
|
|
|
// let min=this.calMin(arr);
|
|
|
// let max=this.calMax(arr);
|
|
|
// if(min<0){
|
|
|
// this.options.yAxis[1].min=-20;
|
|
|
// }
|
|
|
// this.options.yAxis[0].max=max;
|
|
|
// this.options.yAxis[0].min=min;
|
|
|
// this.options.yAxis[0].interval=(max-min)/7
|
...
|
...
|
|