forked from github/dataease
style(图表): 标签的全量显示配置优化及符号地图支持标签的全量显示
This commit is contained in:
parent
f2df1de30c
commit
61bdb7b81d
@ -449,7 +449,7 @@ const conversionPrecision = [
|
||||
{ name: t('chart.reserve_two'), value: 2 }
|
||||
]
|
||||
const noFullDisplay = computed(() => {
|
||||
return !['symbolic-map', 'liquid', 'gauge', 'indicator'].includes(props.chart.type)
|
||||
return !['liquid', 'gauge', 'indicator'].includes(props.chart.type)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -408,6 +408,7 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
.color(label.color)
|
||||
.size(label.fontSize)
|
||||
.style({
|
||||
textAllowOverlap: label.fullDisplay,
|
||||
textAnchor: 'center',
|
||||
textOffset: [0, 0]
|
||||
})
|
||||
|
@ -130,24 +130,27 @@ export class Pie extends G2PlotChartView<PieOptions, G2Pie> {
|
||||
}
|
||||
}
|
||||
const layout = []
|
||||
const type =
|
||||
labelAttr.position === 'inner'
|
||||
? labelAttr.fullDisplay
|
||||
? 'limit-in-plot'
|
||||
: 'custom-layout'
|
||||
: labelAttr.fullDisplay
|
||||
? 'hide-overlap'
|
||||
: 'limit-in-plot'
|
||||
|
||||
if (type === 'custom-layout') {
|
||||
const tmpOptions = super.configLabel(chart, options)
|
||||
layout.push({ type: 'limit-in-plot' })
|
||||
layout.push(...tmpOptions.label.layout)
|
||||
let textAlign = undefined
|
||||
if (labelAttr.position === 'inner') {
|
||||
textAlign = 'center'
|
||||
if (labelAttr.fullDisplay) {
|
||||
layout.push({ type: 'limit-in-plot' })
|
||||
} else {
|
||||
layout.push({ type: 'limit-in-canvas' })
|
||||
layout.push({ type: 'hide-overlap' })
|
||||
}
|
||||
} else {
|
||||
layout.push({ type })
|
||||
if (!labelAttr.fullDisplay) {
|
||||
layout.push({ type: 'limit-in-plot' })
|
||||
}
|
||||
}
|
||||
let labelType = labelAttr.position === 'outer' ? 'spider' : labelAttr.position
|
||||
if (layout.length === 0) {
|
||||
labelType = 'no'
|
||||
}
|
||||
const label = {
|
||||
type: labelAttr.position === 'outer' ? 'spider' : labelAttr.position,
|
||||
type: labelType,
|
||||
textAlign,
|
||||
layout,
|
||||
autoRotate: false,
|
||||
style: {
|
||||
|
@ -157,7 +157,14 @@ export function getLabel(chart: Chart) {
|
||||
layout.push({ type: 'interval-hide-overlap' })
|
||||
} else if (
|
||||
chart.type.indexOf('-horizontal') > -1 ||
|
||||
['bidirectional-bar', 'progress-bar', 'pie', 'pie-donut', 'radar'].includes(chart.type)
|
||||
[
|
||||
'bidirectional-bar',
|
||||
'progress-bar',
|
||||
'pie-donut',
|
||||
'radar',
|
||||
'waterfall',
|
||||
't-heatmap'
|
||||
].includes(chart.type)
|
||||
) {
|
||||
layout.push({ type: 'hide-overlap' })
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user