TODO: fix graphPage build*()
This commit is contained in:
@@ -15,33 +15,42 @@ import * as echarts from 'echarts';
|
||||
export default {
|
||||
name: 'LineDataChart',
|
||||
components: {},
|
||||
props: {},
|
||||
props: {
|
||||
xProps: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
legend: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
inspectionContents: [
|
||||
'检测内容1',
|
||||
'检测内容2',
|
||||
'检测内容3',
|
||||
'检测内容4',
|
||||
'检测内容5',
|
||||
'检测内容6',
|
||||
'检测内容7',
|
||||
'检测内容8',
|
||||
'检测总数',
|
||||
'比例%',
|
||||
],
|
||||
xProps: [
|
||||
'产线1',
|
||||
'产线2',
|
||||
'产线3',
|
||||
'产线4',
|
||||
'产线5',
|
||||
'产线6',
|
||||
'产线7',
|
||||
'产线8',
|
||||
'产线9',
|
||||
],
|
||||
// inspectionContents: [
|
||||
// '检测内容1',
|
||||
// '检测内容2',
|
||||
// '检测内容3',
|
||||
// '检测内容4',
|
||||
// '检测内容5',
|
||||
// '检测内容6',
|
||||
// '检测内容7',
|
||||
// '检测内容8',
|
||||
// '检测总数',
|
||||
// '比例%',
|
||||
// ],
|
||||
// xProps: [
|
||||
// '产线1',
|
||||
// '产线2',
|
||||
// '产线3',
|
||||
// '产线4',
|
||||
// '产线5',
|
||||
// '产线6',
|
||||
// '产线7',
|
||||
// '产线8',
|
||||
// '产线9',
|
||||
// ],
|
||||
series: [
|
||||
{
|
||||
name: '检测内容1',
|
||||
@@ -106,6 +115,7 @@ export default {
|
||||
this.setOption();
|
||||
},
|
||||
setOption(option) {
|
||||
console.log("legend", this.legend)
|
||||
const defaultOption = {
|
||||
// title: {
|
||||
// text: '折线图',
|
||||
@@ -121,7 +131,7 @@ export default {
|
||||
trigger: 'axis',
|
||||
},
|
||||
legend: {
|
||||
data: this.inspectionContents,
|
||||
data: this.legend,
|
||||
top: '5%',
|
||||
icon: 'circle'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user