添加备注,柱状图标线

This commit is contained in:
huangdeliang
2021-03-03 19:25:03 +08:00
parent b8fad6218f
commit 96a405a314
8 changed files with 271 additions and 98 deletions

View File

@ -30,6 +30,10 @@ export default {
type: Array,
default: [],
},
max: {
type: Number,
default: 0,
},
},
data() {
return {
@ -64,6 +68,7 @@ export default {
this.updateChart(this.data.length > 0 ? this.data : {});
},
updateChart(source) {
console.log(this.max);
this.chart.clear();
this.chart.setOption({
title: {
@ -112,7 +117,7 @@ export default {
grid: {
top: 55,
left: 20,
right: 20,
right: 50,
bottom: 10,
containLabel: true,
},
@ -135,6 +140,13 @@ export default {
y: dim,
x: 0,
},
markLine: {
data: [{ name: "BMR", yAxis: this.max - 400 }],
symbol: "none",
lineStyle: {
color: "red",
},
},
itemStyle: {
borderWidth: 2,
borderColor: "#fff",

View File

@ -58,6 +58,16 @@
:data="data"
height="170px"
width="500px"
:max="
healthyData.basicBMR
? parseFloat(
healthyData.basicBMR.substring(
0,
healthyData.basicBMR.indexOf('千卡')
)
)
: 0
"
/>
<PieChart
v-if="data.length === 1"
@ -89,7 +99,7 @@ export default {
},
props: ["collapse", "data"],
computed: {
...mapState(["recipesId", "reviewStatus"]),
...mapState(["recipesId", "reviewStatus", "healthyData"]),
},
methods: {
handleCollapseClick() {