Commit 3fb03412 by liyuhang19990520

警犬

parent a6dff93e
No preview for this file type
......@@ -316,7 +316,7 @@ export default {
};
myChart.setOption(option);
},
getLineCharts(xLabel, series, dom, color) {
getLineCharts(xLabel, series, dom, color,title) {
if(!dom) return;
let myChart = this.$echarts.init(dom);
let option = {
......@@ -324,7 +324,7 @@ export default {
trigger: "axis",
},
title: {
text: "年龄段和性别分布",
text: title,
top: "5%",
left: "2%",
textStyle: {
......@@ -585,7 +585,7 @@ export default {
"#FF9626",
"#27C346",
"#3C7EFF",
]);
],'年龄段和等级分布');
}
});
},
......@@ -626,7 +626,7 @@ export default {
self.getLineCharts(xData, series, self.$refs.age_sex, [
"#FF9626",
"#24A2FF",
]);
],'年龄段和性别分布');
}
});
},
......
......@@ -56,7 +56,7 @@ export default {
},
methods: {
getLineCharts(xLabel, series, dom, color, title) {
if(!dom) return;
if (!dom) return;
let myChart = this.$echarts.init(dom);
let option = {
tooltip: {
......@@ -206,7 +206,7 @@ export default {
//漏斗图
getSourceDis(data) {
let dom = this.$refs.dog_source;
if(!dom) return;
if (!dom) return;
let myChart = this.$echarts.init(dom);
let option = {
tooltip: {
......@@ -350,9 +350,10 @@ export default {
//饼图
getVarietyDis(data) {
let totalNum = 0;
console.log(data, 222);
data.map((item) => (totalNum += item.value));
let dom = this.$refs.dog_breed;
if(!dom) return;
if (!dom) return;
let myChart = this.$echarts.init(dom);
let option = {
title: {
......@@ -366,7 +367,9 @@ export default {
color: "#97A3B7",
fontWeight: "100",
},
subtext: "124",
subtext: data.reduce(function (total, value) {
return total + value.value;
}, 0),
subtextStyle: {
align: "left",
fontSize: 32,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment