forked from github/dataease
refactor(视图): 优化视图默认图例配置
This commit is contained in:
parent
5401a1f9e6
commit
4db2c3e273
@ -125,7 +125,7 @@ export class Funnel extends G2PlotChartView<FunnelOptions, G2Funnel> {
|
||||
)(chart, options)
|
||||
}
|
||||
setupDefaultOptions(chart: ChartObj): ChartObj {
|
||||
const { customAttr } = chart
|
||||
const { customAttr, customStyle } = chart
|
||||
const { label } = customAttr
|
||||
if (!['left', 'middle', 'right'].includes(label.position)) {
|
||||
label.position = 'middle'
|
||||
@ -134,6 +134,8 @@ export class Funnel extends G2PlotChartView<FunnelOptions, G2Funnel> {
|
||||
...label,
|
||||
show: true
|
||||
}
|
||||
const { legend } = customStyle
|
||||
legend.show = false
|
||||
return chart
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ export class Treemap extends G2PlotChartView<TreemapOptions, G2Treemap> {
|
||||
}
|
||||
|
||||
setupDefaultOptions(chart: ChartObj): ChartObj {
|
||||
const customAttr = chart.customAttr
|
||||
const { customAttr, customStyle } = chart
|
||||
const { label } = customAttr
|
||||
customAttr.label = {
|
||||
...label,
|
||||
@ -210,6 +210,8 @@ export class Treemap extends G2PlotChartView<TreemapOptions, G2Treemap> {
|
||||
showProportion: true,
|
||||
reserveDecimalCount: 2
|
||||
}
|
||||
const { legend } = customStyle
|
||||
legend.show = false
|
||||
return chart
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ export class Pie extends G2PlotChartView<PieOptions, G2Pie> {
|
||||
}
|
||||
}
|
||||
setupDefaultOptions(chart: ChartObj): ChartObj {
|
||||
const customAttr = chart.customAttr
|
||||
const { customAttr, customStyle } = chart
|
||||
const { label } = customAttr
|
||||
if (!['inner', 'outer'].includes(label.position)) {
|
||||
label.position = 'outer'
|
||||
@ -230,6 +230,8 @@ export class Pie extends G2PlotChartView<PieOptions, G2Pie> {
|
||||
showProportion: true,
|
||||
reserveDecimalCount: 2
|
||||
}
|
||||
const { legend } = customStyle
|
||||
legend.show = false
|
||||
return chart
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ export class Rose extends G2PlotChartView<RoseOptions, G2Rose> {
|
||||
}
|
||||
|
||||
setupDefaultOptions(chart: ChartObj): ChartObj {
|
||||
const customAttr = chart.customAttr
|
||||
const { customAttr, customStyle } = chart
|
||||
const { label } = customAttr
|
||||
if (!['inner', 'outer'].includes(label.position)) {
|
||||
label.position = 'outer'
|
||||
@ -215,6 +215,8 @@ export class Rose extends G2PlotChartView<RoseOptions, G2Rose> {
|
||||
showProportion: true,
|
||||
reserveDecimalCount: 2
|
||||
}
|
||||
const { legend } = customStyle
|
||||
legend.show = false
|
||||
return chart
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user