Browse Source

图表增加数值单位显示

develop
fuguobin 9 months ago
parent
commit
083da5e4b1
  1. 4
      src/types/components.d.ts
  2. 11
      src/views/data-visual/components/hxPress.vue
  3. 11
      src/views/data-visual/components/hxTemp.vue
  4. 30
      src/views/data-visual/components/priPress.vue
  5. 30
      src/views/data-visual/components/secPress.vue
  6. 30
      src/views/data-visual/components/secTemp.vue

4
src/types/components.d.ts

@ -9,12 +9,15 @@ declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default'] Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default']
Button: typeof import('./../components/Widgets/button.vue')['default'] Button: typeof import('./../components/Widgets/button.vue')['default']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard'] ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog'] ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
@ -30,6 +33,7 @@ declare module '@vue/runtime-core' {
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']

11
src/views/data-visual/components/hxPress.vue

@ -1146,8 +1146,8 @@ function init(data: any) {
offset: offsetData, offset: offsetData,
scale: true, // scale: true, //
// minInterval: 1, // // minInterval: 1, //
min: item.unitMin, // // min: item.unitMin, //
max: item.unitMax, // // max: item.unitMax, //
// interval: 10, // // interval: 10, //
nameTextStyle: { nameTextStyle: {
color: '#D1E1FF', color: '#D1E1FF',
@ -1182,7 +1182,12 @@ function init(data: any) {
smooth: true, smooth: true,
symbol: 'none', symbol: 'none',
yAxisIndex: item.index, yAxisIndex: item.index,
data: item.data data: item.data,
tooltip: {
valueFormatter: function (value: any) {
return value + ' ' + item.paramUnit;
}
}
}); });
}); });
const chart = echarts.init(hxPressRef.value); const chart = echarts.init(hxPressRef.value);

11
src/views/data-visual/components/hxTemp.vue

@ -640,8 +640,8 @@ function init(data: any) {
offset: offsetData, offset: offsetData,
scale: true, // scale: true, //
// minInterval: 1, // // minInterval: 1, //
min: item.unitMin, // // min: item.unitMin, //
max: item.unitMax, // // max: item.unitMax, //
// interval: 10, // // interval: 10, //
nameTextStyle: { nameTextStyle: {
color: '#D1E1FF', color: '#D1E1FF',
@ -676,7 +676,12 @@ function init(data: any) {
smooth: true, smooth: true,
symbol: 'none', symbol: 'none',
yAxisIndex: item.index, yAxisIndex: item.index,
data: item.data data: item.data,
tooltip: {
valueFormatter: function (value: any) {
return value + ' ' + item.paramUnit;
}
}
}); });
}); });
const chart = echarts.init(hxTempRef.value); const chart = echarts.init(hxTempRef.value);

30
src/views/data-visual/components/priPress.vue

@ -103,6 +103,11 @@ const options = {
barWidth: 15, barWidth: 15,
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -112,6 +117,11 @@ const options = {
barWidth: 15, barWidth: 15,
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -121,6 +131,11 @@ const options = {
stack: 'Low Zone', stack: 'Low Zone',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -130,6 +145,11 @@ const options = {
stack: 'Low Zone', stack: 'Low Zone',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -139,6 +159,11 @@ const options = {
stack: 'High Area', stack: 'High Area',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -148,6 +173,11 @@ const options = {
stack: 'High Area', stack: 'High Area',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
} }
] ]

30
src/views/data-visual/components/secPress.vue

@ -103,6 +103,11 @@ const options = {
barWidth: 15, barWidth: 15,
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -112,6 +117,11 @@ const options = {
barWidth: 15, barWidth: 15,
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -121,6 +131,11 @@ const options = {
stack: 'Low Zone', stack: 'Low Zone',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -130,6 +145,11 @@ const options = {
stack: 'Low Zone', stack: 'Low Zone',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -139,6 +159,11 @@ const options = {
stack: 'High Area', stack: 'High Area',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
}, },
{ {
@ -148,6 +173,11 @@ const options = {
stack: 'High Area', stack: 'High Area',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' Mpa';
}
} }
} }
] ]

30
src/views/data-visual/components/secTemp.vue

@ -103,6 +103,11 @@ const options = {
barWidth: 15, barWidth: 15,
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' °C';
}
} }
}, },
{ {
@ -112,6 +117,11 @@ const options = {
barWidth: 15, barWidth: 15,
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' °C';
}
} }
}, },
{ {
@ -121,6 +131,11 @@ const options = {
stack: 'Low Zone', stack: 'Low Zone',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' °C';
}
} }
}, },
{ {
@ -130,6 +145,11 @@ const options = {
stack: 'Low Zone', stack: 'Low Zone',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' °C';
}
} }
}, },
{ {
@ -139,6 +159,11 @@ const options = {
stack: 'High Area', stack: 'High Area',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' °C';
}
} }
}, },
{ {
@ -148,6 +173,11 @@ const options = {
stack: 'High Area', stack: 'High Area',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
},
tooltip: {
valueFormatter: function (value: any) {
return value + ' °C';
}
} }
} }
] ]

Loading…
Cancel
Save