Merge remote-tracking branch 'gitee/master'

master
wangh 4 years ago
commit 0d5e8f7474

@ -1,5 +1,5 @@
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
let time1 =() =>{}
// 随机数 // 随机数
const random = (val = 1) => { const random = (val = 1) => {
return Math.ceil(Math.random() * val) return Math.ceil(Math.random() * val)
@ -138,9 +138,7 @@ const horizontalRoundedBarChartWithBackground = function (data, id) {
$(window).resize(charts.resize); $(window).resize(charts.resize);
} }
const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) { const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
let time = () => { clearInterval(time1)
}
clearInterval(time)
let charts = echarts.init(id); let charts = echarts.init(id);
if (!data) { if (!data) {
data = { data = {
@ -254,8 +252,7 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
}) })
let step = 1 / (data.yNameOne.length / 9) * 100 let step = 1 / (data.yNameOne.length / 9) * 100
time = () => { time1 = setInterval(() => {
setInterval(() => {
option.dataZoom[0].end += step option.dataZoom[0].end += step
option.dataZoom[0].start += step option.dataZoom[0].start += step
if (option.dataZoom[0].start >= 100) { if (option.dataZoom[0].start >= 100) {
@ -268,8 +265,7 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
} }
charts.setOption(option); charts.setOption(option);
}, 6000) }, 6000)
} // time()
time()
} }
charts.setOption(option); charts.setOption(option);
$(window).resize(charts.resize); $(window).resize(charts.resize);

Loading…
Cancel
Save