mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-10 11:02:16 +00:00
perf: 优化控制台仪表盘显示
This commit is contained in:
parent
8ecd2cfc6a
commit
d6de7cce24
@ -45,7 +45,8 @@ export default {
|
|||||||
const total = _.sumBy(this.data, function(i) { return i.total })
|
const total = _.sumBy(this.data, function(i) { return i.total })
|
||||||
for (let i = 0, len = this.data.length; i < len; i++) {
|
for (let i = 0, len = this.data.length; i < len; i++) {
|
||||||
const current = this.data[i]
|
const current = this.data[i]
|
||||||
const num = (current.total / total) * 100
|
let num = (current.total / total) * 100
|
||||||
|
num = _.floor(num, 2)
|
||||||
const color = '#' + Math.floor(Math.random() * (256 * 256 * 256 - 1)).toString(16)
|
const color = '#' + Math.floor(Math.random() * (256 * 256 * 256 - 1)).toString(16)
|
||||||
seriesList.push({
|
seriesList.push({
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
@ -132,7 +133,7 @@ export default {
|
|||||||
grid: {
|
grid: {
|
||||||
top: '60%',
|
top: '60%',
|
||||||
containLabel: true,
|
containLabel: true,
|
||||||
bottom: '0',
|
bottom: '-10',
|
||||||
left: '0%',
|
left: '0%',
|
||||||
right: 1
|
right: 1
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user