fix(图表): 修复从分组柱线图切换堆叠柱线组合图后,堆叠项排序选项不正确问题

This commit is contained in:
ulleo 2024-08-20 15:15:44 +08:00
parent 3ded3bf105
commit baf6731375
2 changed files with 17 additions and 9 deletions

View File

@ -589,6 +589,11 @@ public class ChartDataManage {
// get all fields
List<ChartViewFieldDTO> allFields = getAllChartFields(view);
// 针对分组切换堆叠时会遇到的问题
if (StringUtils.equalsIgnoreCase(view.getType(), "bar-stack") || StringUtils.equalsIgnoreCase(view.getType(), "chart-mix-stack")) {
view.setXAxisExt(new ArrayList<>());
}
List<ChartViewFieldDTO> xAxisBase = new ArrayList<>(view.getXAxis());
List<ChartViewFieldDTO> xAxis = new ArrayList<>(view.getXAxis());
List<ChartViewFieldDTO> xAxisExt = new ArrayList<>(view.getXAxisExt());

View File

@ -45,7 +45,10 @@ export class ColumnLineMix extends G2PlotChartView<DualAxesOptions, DualAxes> {
}
axis: AxisType[] = [...CHART_MIX_AXIS_TYPE, 'xAxisExtRight', 'yAxisExt']
axisConfig = {
...this['axisConfig'],
xAxis: {
name: `${t('chart.drag_block_type_axis')} / ${t('chart.dimension')}`,
type: 'd'
},
yAxis: {
name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`,
limit: 1,
@ -595,10 +598,10 @@ export class GroupColumnLineMix extends ColumnLineMix {
}
axisConfig = {
...this['axisConfig'],
yAxis: {
name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`,
limit: 1,
type: 'q'
xAxisExt: {
name: `${t('chart.chart_group')} / ${t('chart.dimension')}`,
type: 'd',
limit: 1
}
}
@ -706,10 +709,10 @@ export class StackColumnLineMix extends ColumnLineMix {
}
axisConfig = {
...this['axisConfig'],
yAxis: {
name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`,
limit: 1,
type: 'q'
extStack: {
name: `${t('chart.stack_item')} / ${t('chart.dimension')}`,
type: 'd',
limit: 1
}
}