Skip to content

Commit 06ed2c6

Browse files
committed
refine dashboard charts animation
1 parent 67c4a3b commit 06ed2c6

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/views/dashboard/editor/barChart.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<script>
66
import echarts from 'echarts';
77
require('echarts/theme/macarons'); // echarts 主题
8-
8+
const animationDuration = 3000;
99
export default {
1010
props: {
1111
className: {
@@ -68,19 +68,22 @@
6868
type: 'bar',
6969
stack: 'vistors',
7070
barWidth: '60%',
71-
data: [79, 52, 200, 334, 390, 330, 220]
71+
data: [79, 52, 200, 334, 390, 330, 220],
72+
animationDuration
7273
}, {
7374
name: 'pageB',
7475
type: 'bar',
7576
stack: 'vistors',
7677
barWidth: '60%',
77-
data: [80, 52, 200, 334, 390, 330, 220]
78+
data: [80, 52, 200, 334, 390, 330, 220],
79+
animationDuration
7880
}, {
7981
name: 'pageC',
8082
type: 'bar',
8183
stack: 'vistors',
8284
barWidth: '60%',
83-
data: [30, 52, 200, 334, 390, 330, 220]
85+
data: [30, 52, 200, 334, 390, 330, 220],
86+
animationDuration
8487
}]
8588
})
8689
}

src/views/dashboard/editor/lineChart.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@
9090
},
9191
smooth: true,
9292
type: 'line',
93-
data: [100, 120, 161, 134, 105, 160, 165]
93+
data: [100, 120, 161, 134, 105, 160, 165],
94+
animationDuration: 2600,
95+
animationEasing: 'cubicInOut'
9496
},
9597
{
9698
name: 'buyers',
@@ -107,7 +109,9 @@
107109
}
108110
}
109111
},
110-
data: [120, 82, 91, 154, 162, 140, 130]
112+
data: [120, 82, 91, 154, 162, 140, 130],
113+
animationDuration: 2000,
114+
animationEasing: 'quadraticOut'
111115
}]
112116
})
113117
}

src/views/dashboard/editor/pieChart.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
{ value: 100, name: 'gold' },
6868
{ value: 59, name: 'forecastsx' },
6969
{ value: 49, name: 'markets' }
70-
]
70+
],
71+
animationEasing: 'cubicInOut',
72+
animationDuration: 2600
7173
}
7274
]
7375
})

0 commit comments

Comments
 (0)