修改样式

This commit is contained in:
yangjun 2025-10-29 11:10:34 +08:00
parent 391f70825f
commit cfb9f0ab6c
1 changed files with 24 additions and 60 deletions

View File

@ -136,7 +136,7 @@
<div class="header-left">
<img src="./dashboard/dp_icon4.png" alt="icon" />
<span class="header-left-text">乡镇压力供压回压</span>
<span class="header-left-text" style="margin-left: 130px;">单位MPa</span>
<span class="header-left-text" style="margin-left: 90px;">单位MPa</span>
</div>
</div>
<div class=" area-body"></div>
@ -619,16 +619,16 @@ function updateChartCounty() {
if (!chartCounty) return;
const names = countyList.value.map(i => i.raw?.view028 ?? '未知');
const values = countyList.value.map(i => (i.raw?.view035 ? Number(i.raw.view035) : 0));
const values1 = countyList.value.map(i => (i.raw?.view035 ? Number(i.raw.view035) : 0));
const values2 = countyList.value.map(i => (i.raw?.view036 ? Number(i.raw.view036) : 0));
const maxVal = values.length ? Math.max(...values, ...values2) * 1.15 : 100;
const maxVal = values1.length ? Math.max(...values1) : 100;
chartCounty.setOption({
grid: {
left: 10,
right: 120, //
bottom: 14,
top: 28,
bottom: 8,
top: 18,
containLabel: true
},
tooltip: {
@ -664,8 +664,8 @@ function updateChartCounty() {
axisLabel: {
color: jbztys.value,
interval: 0,
fontSize: 16, //
margin: 2 //
fontSize: 12, //
margin: 0 //
},
axisTick: { show: false },
axisLine: { show: false }
@ -691,9 +691,9 @@ function updateChartCounty() {
// -
{
type: 'bar',
barWidth: 10, //
barGap: '60%', //
data: values.map((val, index) => ({
barWidth: 8, //
barGap: '30%', //
data: values1.map((val, index) => ({
value: val,
itemStyle: {
color: {
@ -712,8 +712,8 @@ function updateChartCounty() {
// -
{
type: 'bar',
barWidth: 10, //
barGap: '60%', //
barWidth: 8, //
barGap: '30%', //
data: values2.map((val, index) => ({
value: val,
itemStyle: {
@ -730,14 +730,14 @@ function updateChartCounty() {
z: 3
},
//
// //
{
type: 'pictorialBar',
symbol: `image://${lqImg}`,
symbolSize: [25, 25], //
symbolOffset: [13, -7], //
symbolOffset: [11, -4], //
symbolPosition: 'end',
data: values,
data: values1,
z: 4,
silent: true
},
@ -747,7 +747,7 @@ function updateChartCounty() {
type: 'pictorialBar',
symbol: `image://${lqImg}`,
symbolSize: [25, 25], //
symbolOffset: [13, 9], //
symbolOffset: [13, 6], //
symbolPosition: 'end',
data: values2,
z: 5,
@ -758,20 +758,23 @@ function updateChartCounty() {
{
type: 'bar',
barWidth: 8,
data: values.map(() => maxVal),
data: values1.map(() => maxVal.toFixed(1)),
itemStyle: { color: 'transparent' },
label: {
show: true,
position: 'right',
distance: 40,
fontSize: 18, //
fontSize: 16, //
offset: [-20, -20], //
align: 'left',
color: '#ffffff',
formatter: (params) => {
const value = values[params.dataIndex];
console.log("🚀 ~ updateChartCounty ~ params:", params)
const value1 = values1[params.dataIndex];
console.log("🚀 ~ updateChartCounty ~ value1:", value1)
const value2 = values2[params.dataIndex];
return `{icon|} ${value.toFixed(1)} - ${value2.toFixed(2)}`; //
console.log("🚀 ~ updateChartCounty ~ value2:", value2)
return `{icon|} ${value1.toFixed(1)} - ${value2.toFixed(1)}`; //
},
rich: {
icon: {
@ -784,55 +787,16 @@ function updateChartCounty() {
}
}
},
z: 7,
z: 6,
silent: true
},
// -
// {
// type: 'bar',
// barWidth: 8,
// data: values2.map(() => maxVal),
// itemStyle: { color: 'transparent' },
// label: {
// show: true,
// position: 'right',
// distance: 40, //
// fontSize: 12, //
// offset: [0, -20], //
// align: 'left',
// color: '#ffffff',
// formatter: (params) => {
// const value = values2[params.dataIndex];
// return `{icon2|} ${value.toFixed(1)}`; //
// },
// rich: {
// icon2: {
// width: 12,
// height: 12,
// align: 'center',
// backgroundColor: {
// image: ljt
// }
// }
// }
// },
// z: 7,
// silent: true
// }
],
}, true);
//
chartCounty.off('click');
chartCounty.on('click', function(params) {
if (params.seriesIndex === 1 || params.seriesIndex === 2) {
const clickedName = params.name;
const gsValue = values[params.dataIndex];
const hsValue = values2[params.dataIndex];
//
}
});
}
// area-7