forked from github/dataease
fix(图表): 修复从对称条形图切换为柱线组合组后,右轴显示不正确的问题
This commit is contained in:
parent
049c661fd5
commit
3ba3ed27e4
@ -246,57 +246,63 @@ export class ColumnLineMix extends G2PlotChartView<DualAxesOptions, DualAxes> {
|
|||||||
...options
|
...options
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tempOption.yAxis = {}
|
||||||
if (!yAxis) {
|
if (!yAxis) {
|
||||||
//左右轴都要隐藏
|
//左右轴都要隐藏
|
||||||
tempOption.yAxis = {
|
tempOption.yAxis.value = false
|
||||||
value: false,
|
|
||||||
valueExt: false
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
tempOption.yAxis = {
|
tempOption.yAxis.value = undefined
|
||||||
value: undefined,
|
yAxis.position = 'left'
|
||||||
valueExt: undefined
|
|
||||||
|
const yAxisTmp = parseJson(chart.customStyle).yAxis
|
||||||
|
if (yAxis.label) {
|
||||||
|
yAxis.label.style.textAlign = 'end'
|
||||||
|
yAxis.label.formatter = value => {
|
||||||
|
return valueFormatter(value, yAxisTmp.axisLabelFormatter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const axisValue = yAxisTmp.axisValue
|
||||||
|
if (!axisValue?.auto) {
|
||||||
|
tempOption.yAxis.value = {
|
||||||
|
...yAxis,
|
||||||
|
min: axisValue.min,
|
||||||
|
max: axisValue.max,
|
||||||
|
minLimit: axisValue.min,
|
||||||
|
maxLimit: axisValue.max,
|
||||||
|
tickCount: axisValue.splitCount
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tempOption.yAxis.value = yAxis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const yAxisTmp = parseJson(chart.customStyle).yAxis
|
if (!yAxisExt) {
|
||||||
if (yAxis.label) {
|
//左右轴都要隐藏
|
||||||
yAxis.label.formatter = value => {
|
tempOption.yAxis.valueExt = false
|
||||||
return valueFormatter(value, yAxisTmp.axisLabelFormatter)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const axisValue = yAxisTmp.axisValue
|
|
||||||
if (!axisValue?.auto) {
|
|
||||||
tempOption.yAxis.value = {
|
|
||||||
...yAxis,
|
|
||||||
min: axisValue.min,
|
|
||||||
max: axisValue.max,
|
|
||||||
minLimit: axisValue.min,
|
|
||||||
maxLimit: axisValue.max,
|
|
||||||
tickCount: axisValue.splitCount
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
tempOption.yAxis.value = yAxis
|
tempOption.yAxis.valueExt = undefined
|
||||||
}
|
yAxisExt.position = 'right'
|
||||||
|
|
||||||
const yAxisExtTmp = parseJson(chart.customStyle).yAxisExt
|
const yAxisExtTmp = parseJson(chart.customStyle).yAxisExt
|
||||||
if (yAxisExt.label) {
|
if (yAxisExt.label) {
|
||||||
yAxisExt.label.formatter = value => {
|
yAxisExt.label.style.textAlign = 'start'
|
||||||
return valueFormatter(value, yAxisExtTmp.axisLabelFormatter)
|
yAxisExt.label.formatter = value => {
|
||||||
|
return valueFormatter(value, yAxisExtTmp.axisLabelFormatter)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
const axisExtValue = yAxisExtTmp.axisValue
|
||||||
const axisExtValue = yAxisExtTmp.axisValue
|
if (!axisExtValue?.auto) {
|
||||||
if (!axisExtValue?.auto) {
|
tempOption.yAxis.valueExt = {
|
||||||
tempOption.yAxis.valueExt = {
|
...yAxisExt,
|
||||||
...yAxisExt,
|
min: axisExtValue.min,
|
||||||
min: axisExtValue.min,
|
max: axisExtValue.max,
|
||||||
max: axisExtValue.max,
|
minLimit: axisExtValue.min,
|
||||||
minLimit: axisExtValue.min,
|
maxLimit: axisExtValue.max,
|
||||||
maxLimit: axisExtValue.max,
|
tickCount: axisExtValue.splitCount
|
||||||
tickCount: axisExtValue.splitCount
|
}
|
||||||
|
} else {
|
||||||
|
tempOption.yAxis.valueExt = yAxisExt
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
tempOption.yAxis.valueExt = yAxisExt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tempOption
|
return tempOption
|
||||||
|
Loading…
Reference in New Issue
Block a user