mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
redesign Dashboard
This commit is contained in:
parent
d50bb154f1
commit
46e86d2a3d
17 changed files with 834 additions and 167 deletions
93
frontend/src/components/Chart/RadialBarChart.vue
Normal file
93
frontend/src/components/Chart/RadialBarChart.vue
Normal file
|
@ -0,0 +1,93 @@
|
|||
<template>
|
||||
<div class="container">
|
||||
<p class="text">{{ centerText }}</p>
|
||||
<apexchart type="radialBar" height="205" :options="chartOptions" :series="series" ref="chart"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueApexCharts from 'vue-apexcharts'
|
||||
import Vue from 'vue'
|
||||
|
||||
Vue.use(VueApexCharts)
|
||||
Vue.component('apexchart', VueApexCharts)
|
||||
export default {
|
||||
name: 'RadialBarChart',
|
||||
props: {
|
||||
series: Array,
|
||||
centerText: String,
|
||||
colors: String,
|
||||
name: String,
|
||||
},
|
||||
watch: {
|
||||
series: {
|
||||
deep: true,
|
||||
handler() {
|
||||
this.$refs.chart.updateSeries(this.series)
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chartOptions: {
|
||||
series: this.series,
|
||||
chart: {
|
||||
type: 'radialBar',
|
||||
offsetY: -10
|
||||
},
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
startAngle: -135,
|
||||
endAngle: 135,
|
||||
dataLabels: {
|
||||
name: {
|
||||
fontSize: '15px',
|
||||
color: this.colors,
|
||||
offsetY: 56
|
||||
},
|
||||
value: {
|
||||
offsetY: 60,
|
||||
fontSize: '14px',
|
||||
color: undefined,
|
||||
formatter: function (val) {
|
||||
return val + "%";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
colors: this.colors
|
||||
},
|
||||
labels: [this.name],
|
||||
states: {
|
||||
hover: {
|
||||
filter: {
|
||||
type: 'none'
|
||||
}
|
||||
},
|
||||
active: {
|
||||
filter: {
|
||||
type: 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
.text {
|
||||
position: absolute;
|
||||
top: calc(72px);
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue