Browse Source

图表优化

master
suyanyan 1 month ago
parent
commit
3d36a9351a
2 changed files with 33 additions and 2 deletions
  1. +1
    -1
      SafeCampus.WEB/src/views/violation/portrait/detail.vue
  2. +32
    -1
      SafeCampus.WEB/src/views/violation/portraitSummary/index.vue

+ 1
- 1
SafeCampus.WEB/src/views/violation/portrait/detail.vue View File

@@ -125,6 +125,7 @@ const getCharts = (data: any) => {
data: nameArr data: nameArr
}, },
yAxis: { yAxis: {
name: "次",
type: "value", type: "value",
splitLine: { splitLine: {
show: true, show: true,
@@ -140,7 +141,6 @@ const getCharts = (data: any) => {
fontSize: 12 fontSize: 12
} }
}, },
name: "",
nameTextStyle: { nameTextStyle: {
color: "#333", color: "#333",
fontSize: 12 fontSize: 12


+ 32
- 1
SafeCampus.WEB/src/views/violation/portraitSummary/index.vue View File

@@ -96,6 +96,18 @@ function getCharts1() {
show: true show: true
} }
}, },
itemStyle: {
normal: {
label: {
show: true,
// position:'inside',
formatter: "{b} : {c}人"
}
},
labelLine: {
show: true
}
},
data: [ data: [
{ {
value: 62, value: 62,
@@ -119,6 +131,13 @@ function getCharts1() {
function getCharts2() { function getCharts2() {
const chartstation = echarts.init(chart2.value); const chartstation = echarts.init(chart2.value);
const option = { const option = {
legend: {
show: true,
right: "0%",
top: "center",
orient: "vertical",
data: ["<20", ">60岁", "50-60岁", "40-50岁", "30-40岁", "20-30岁"]
},
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)" formatter: "{a} <br/>{b} : {c} ({d}%)"
@@ -156,7 +175,19 @@ function getCharts2() {
value: 30, value: 30,
name: "20-30岁" name: "20-30岁"
} }
]
],
itemStyle: {
normal: {
label: {
show: true,
// position:'inside',
formatter: "{b} : {c}人"
}
},
labelLine: {
show: true
}
}
} }
] ]
}; };


Loading…
Cancel
Save