gamma->interActive tool -> Nuclide review (选择table一条数据) 里面曲线图 y 轴有点显示不全

This commit is contained in:
任珮宇 2023-12-12 09:47:56 +08:00
parent 580c4fdfb7
commit dca4b320d8

View File

@ -8,77 +8,78 @@ const initialOption = {
grid: { grid: {
top: 40, top: 40,
bottom: 50, bottom: 50,
right: 30 right: 30,
left: 50,
}, },
title: { title: {
text: 'Energy', text: 'Energy',
textStyle: { textStyle: {
color: '#8FD4F8', color: '#8FD4F8',
fontSize: 14, fontSize: 14,
fontWeight: 'normal' fontWeight: 'normal',
}, },
right: 10, right: 10,
bottom: 5 bottom: 5,
}, },
xAxis: { xAxis: {
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: 'rgb(119, 181, 213, 0.5)' color: 'rgb(119, 181, 213, 0.5)',
} },
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: 'rgba(119, 181, 213, .2)' color: 'rgba(119, 181, 213, .2)',
} },
}, },
axisLabel: { axisLabel: {
color: '#ade6ee' color: '#ade6ee',
}, },
min: 'dataMin', min: 'dataMin',
max: 'dataMax', max: 'dataMax',
animation: false animation: false,
}, },
yAxis: { yAxis: {
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: 'rgb(119, 181, 213, 0.5)' color: 'rgb(119, 181, 213, 0.5)',
} },
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: 'rgba(119, 181, 213, .2)' color: 'rgba(119, 181, 213, .2)',
} },
}, },
axisLabel: { axisLabel: {
color: '#ade6ee' color: '#ade6ee',
}, },
axisTick: { axisTick: {
show: false show: false,
}, },
name: 'Counts', name: 'Counts',
nameTextStyle: { nameTextStyle: {
color: '#8FD4F8', color: '#8FD4F8',
fontSize: 14 fontSize: 14,
}, },
animation: false animation: false,
}, },
series: [] series: [],
} }
export default { export default {
components: { components: {
CustomChart CustomChart,
}, },
props: { props: {
data: { data: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
} },
}, },
data() { data() {
return { return {
option: cloneDeep(initialOption) option: cloneDeep(initialOption),
} }
}, },
watch: { watch: {
@ -89,7 +90,7 @@ export default {
const series = [] const series = []
chartData.forEach(({ pointlist, color }) => { chartData.forEach(({ pointlist, color }) => {
// line yAxis // line yAxis
if(color === '#F5E91A'){ if (color === '#F5E91A') {
this.option.yAxis.max = Math.ceil(Math.max(...pointlist.map(({ y }) => y))) this.option.yAxis.max = Math.ceil(Math.max(...pointlist.map(({ y }) => y)))
this.option.yAxis.min = Math.floor(Math.min(...pointlist.map(({ y }) => y))) this.option.yAxis.min = Math.floor(Math.min(...pointlist.map(({ y }) => y)))
} }
@ -97,7 +98,7 @@ export default {
type: 'line', type: 'line',
data: pointlist.map(({ x, y }) => [x, y]), data: pointlist.map(({ x, y }) => [x, y]),
itemStyle: { itemStyle: {
color color,
}, },
symbol: 'none', symbol: 'none',
animation: false, animation: false,
@ -112,7 +113,6 @@ export default {
// } // }
// } // }
}) })
}) })
series[0].markLine = { series[0].markLine = {
@ -123,24 +123,23 @@ export default {
formatter: '{c} keV', formatter: '{c} keV',
color: '#f00', color: '#f00',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 14 fontSize: 14,
} },
} },
], ],
symbol: 'none', symbol: 'none',
lineStyle: { lineStyle: {
color: '#f00' color: '#f00',
}, },
emphasis: { emphasis: {
disabled: true disabled: true,
} },
} }
this.option.series = series this.option.series = series
}, },
immediate: true immediate: true,
} },
} },
} }
</script> </script>