Commit 10f014a5 authored by 琉璃丶c's avatar 琉璃丶c

1.修改echarts的endvalue算法第一版

parent 24252609
...@@ -49,6 +49,16 @@ export default { ...@@ -49,6 +49,16 @@ export default {
let _this = this let _this = this
let layout = document.getElementById('chartView') let layout = document.getElementById('chartView')
let chart = echarts.init(layout) let chart = echarts.init(layout)
// let endValue = 10 - Math.ceil(this.xList.length / 100)
// if (endValue <= 0) {
// endValue = 5
// }
let endValue = _this.xList.length
while (endValue > 10) {
endValue = endValue / 6
}
console.log(_this.xList.length, endValue)
let options = { let options = {
// animation: false, // animation: false,
color: '#02a7f0', color: '#02a7f0',
...@@ -59,7 +69,7 @@ export default { ...@@ -59,7 +69,7 @@ export default {
xAxisIndex: [0], xAxisIndex: [0],
filterMode: 'none', filterMode: 'none',
start: 0, start: 0,
end: 2, end: endValue,
zoomLock: true zoomLock: true
} }
], ],
...@@ -94,7 +104,8 @@ export default { ...@@ -94,7 +104,8 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
color: '#999999' color: '#999999' // ,
// interval: 1
}, },
axisTick: { axisTick: {
alignWithLabel: true alignWithLabel: true
...@@ -110,8 +121,8 @@ export default { ...@@ -110,8 +121,8 @@ export default {
}, },
axisLabel: { axisLabel: {
color: '#999999', color: '#999999',
formatter: '{value} ℃', formatter: '{value} ℃'// ,
interval: 0.5 // interval: 0.5
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment