diff --git a/src/pages/index/components/pests-chart.vue b/src/pages/index/components/pests-chart.vue index f21e8ee..5ff4d83 100644 --- a/src/pages/index/components/pests-chart.vue +++ b/src/pages/index/components/pests-chart.vue @@ -230,9 +230,15 @@ export default { seriesData.push(resData[key]) }) const max = Math.max(...seriesData) - let maxN = Math.ceil(max / 5) * 5 - maxN = maxN === 0 ? 5 : maxN - this.opts.yAxis.data[0].max = maxN + + if (max > 5) { + let maxN = Math.ceil(max / 5) * 5 + maxN = maxN === 0 ? 5 : maxN + this.opts.yAxis.data[0].max = maxN + } else { + this.opts.yAxis.splitNumber = max + } + let res = { categories: xAxis, series: [