Commit 9cc7dd04 by chenwq

折线图-取值范围

1 parent 61f94183
......@@ -39,6 +39,7 @@ export default {
type: Array,
default: () => []
},
// 0-月表;1-日表
queryType: {
type: Number,
default: 0
......@@ -161,10 +162,13 @@ export default {
})
var seriesDate = this.dataList.map(item => +item.num)
this.lineOptions.series[0].data = seriesDate
this.lineOptions.yAxis.scale = true
this.lineOptions.tooltip.textStyle.fontSize = this.setChartFontSize(10)
// this.lineOptions.yAxis.min = Math.min(...seriesDate)
// this.lineOptions.yAxis.max = Math.max(...seriesDate)
if (this.queryType == 0) {
this.lineOptions.yAxis.scale = true
} else {
this.lineOptions.yAxis.max = Math.ceil(Math.max(...seriesDate) / 10) * 10
this.lineOptions.yAxis.min = Math.floor(Math.min(...seriesDate) * 0.9 / 10) * 10
}
this[this.domId].setOption(this.lineOptions)
// 默认展示tooltip
this.chartAction()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!