fix:优化图表

zlx
zhoulexin 7 hours ago
parent e59a59eec8
commit 913472fa39

@ -77,7 +77,7 @@ function updateBarChart() {
}))
// 9 -
const remainData = props.counts.map((item, idx) => ({
value: Math.max(0, 9 - item.count),
value: Math.max(0, 10 - item.count),
itemStyle: { color: lightenColor(colors[idx % colors.length], 0.7), borderRadius: [4, 4, 0, 0] }
}))
@ -88,7 +88,8 @@ function updateBarChart() {
formatter(params) {
const actual = params.find(p => p.seriesName === '实际值')
if (!actual) return ''
return `${actual.name}<br/>${actual.marker} 检测数: ${actual.value}/9`
// return `${actual.name}<br/>${actual.marker} : ${actual.value}/9`
return `${actual.name}<br/>${actual.marker} 检测数: ${actual.value}`
}
},
grid: { left: '5%', right: '5%', bottom: '5%', top: '15%', containLabel: true },
@ -96,7 +97,7 @@ function updateBarChart() {
yAxis: {
type: 'value',
minInterval: 1,
max: 9,
// max: 9,
splitLine: { lineStyle: { type: 'dashed', color: '#eee' } }
},
series: [
@ -106,18 +107,18 @@ function updateBarChart() {
stack: 'total',
barWidth: 22,
data: actualData,
markLine: {
silent: true,
symbol: 'none',
lineStyle: { color: '#e6a23c', type: 'dashed', width: 2 },
label: {
formatter: '上限: 9',
color: '#e6a23c',
fontSize: 12,
position: 'insideEndTop'
},
data: [{ yAxis: 9 }]
}
// markLine: {
// silent: true,
// symbol: 'none',
// lineStyle: { color: '#e6a23c', type: 'dashed', width: 2 },
// label: {
// formatter: ': 9',
// color: '#e6a23c',
// fontSize: 12,
// position: 'insideEndTop'
// },
// data: [{ yAxis: 9 }]
// }
},
{
type: 'bar',

Loading…
Cancel
Save