Commit 8e2957ce authored by ww-xxy's avatar ww-xxy

修改绩效目标

parent 33eafaaf
......@@ -21,26 +21,52 @@ export default {
},
styleObj: {
type: Object,
default: () => {},
default: () => { },
},
parameter: {
type: Object,
default: () => { }
}
},
data() {
return {};
return {
myChart: null
};
},
watch: {
title(val) {
console.log(val);
this.drawLine();
this.myChart && this.myChart.setOption({title:{text:val}})
},
parameter: {
handler: function (v) {
this.drawLine(v)
},
deep: true
}
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
drawLine(obj) {
if (obj && this.myChart) {
// 更新
this.myChart.setOption({
xAxis: {
data: obj.x
},
series: [
{
data: obj.y,
},
]
})
return
}
// 基于dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById(this.id));
this.myChart = myChart
// 绘制图表
myChart.setOption({
title: {
......@@ -50,7 +76,7 @@ export default {
fontSize: this.legendName == "旷工率" ? 24 : 18,
},
},
color:'#6e98ed',
color: '#6e98ed',
legend: {
orient: "horizontal",
right: "50px",
......@@ -65,7 +91,7 @@ export default {
},
tooltip: {},
xAxis: {
data: ["部门1", "部门2", "部门3", "部门4", "部门5", "部门6"],
data: [],
},
grid: {
left: "5%",
......@@ -79,9 +105,9 @@ export default {
{
name: this.legendName,
type: "bar",
data: [5, 20, 36, 10, 10, 20],
data: [],
itemStyle: {
lineStyle: {
type: "dotted", //'dotted'虚线 'solid'实线
},
......
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