Commit 7376f0d4 authored by shangtx's avatar shangtx

feat(年工时基准表): 条型图添加label

parent dda05e7d
......@@ -25,11 +25,15 @@
<v-chart :forceFit="true" :height="height" :data="data">
<v-coord type="rect" direction="LB" />
<!-- <v-tooltip /> -->
<v-legend
:itemFormatter="itemFormatter"
<v-legend :itemFormatter="itemFormatter" />
<v-axis dataKey="name" />
<v-stack-bar
position="name*value"
:color="['type']"
:label="['value', (value) => {
return value == 0 ? ' ': value;
} ]"
/>
<v-axis dataKey="name" :label="label" />
<v-stack-bar position="name*工时" color="类型" />
<v-guide
type="line"
:top="true"
......@@ -40,7 +44,7 @@
fontSize: 12,
fontWeight: 500,
lineWidth: 2,
lineDash: [5,1]
lineDash: [5, 1],
}"
:text="{
position: 'start',
......@@ -73,9 +77,9 @@ export default {
height: 800,
label,
legendMap: {
beforeJoin: '入职前标准工时',
value: '已消耗工时'
}
beforeJoin: "入职前标准工时",
value: "已消耗工时",
},
};
},
methods: {
......@@ -86,11 +90,12 @@ export default {
dv.transform({
type: "fold",
fields: ["beforeJoin", "value"],
key: "类型",
value: "工时",
key: "type",
value: "value",
retains: ["name"],
});
this.data = dv.rows;
console.info(this.data);
});
},
itemFormatter(text) {
......
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