forked from github/dataease
Merge pull request #11654 from ulleo/dev-v2
fix(图表): 修复从分组柱线图切换堆叠柱线组合图后,堆叠项排序选项不正确问题
This commit is contained in:
commit
12f1875c5b
@ -589,6 +589,11 @@ public class ChartDataManage {
|
|||||||
// get all fields
|
// get all fields
|
||||||
List<ChartViewFieldDTO> allFields = getAllChartFields(view);
|
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> xAxisBase = new ArrayList<>(view.getXAxis());
|
||||||
List<ChartViewFieldDTO> xAxis = new ArrayList<>(view.getXAxis());
|
List<ChartViewFieldDTO> xAxis = new ArrayList<>(view.getXAxis());
|
||||||
List<ChartViewFieldDTO> xAxisExt = new ArrayList<>(view.getXAxisExt());
|
List<ChartViewFieldDTO> xAxisExt = new ArrayList<>(view.getXAxisExt());
|
||||||
|
@ -45,7 +45,10 @@ export class ColumnLineMix extends G2PlotChartView<DualAxesOptions, DualAxes> {
|
|||||||
}
|
}
|
||||||
axis: AxisType[] = [...CHART_MIX_AXIS_TYPE, 'xAxisExtRight', 'yAxisExt']
|
axis: AxisType[] = [...CHART_MIX_AXIS_TYPE, 'xAxisExtRight', 'yAxisExt']
|
||||||
axisConfig = {
|
axisConfig = {
|
||||||
...this['axisConfig'],
|
xAxis: {
|
||||||
|
name: `${t('chart.drag_block_type_axis')} / ${t('chart.dimension')}`,
|
||||||
|
type: 'd'
|
||||||
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`,
|
name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`,
|
||||||
limit: 1,
|
limit: 1,
|
||||||
@ -595,10 +598,10 @@ export class GroupColumnLineMix extends ColumnLineMix {
|
|||||||
}
|
}
|
||||||
axisConfig = {
|
axisConfig = {
|
||||||
...this['axisConfig'],
|
...this['axisConfig'],
|
||||||
yAxis: {
|
xAxisExt: {
|
||||||
name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`,
|
name: `${t('chart.chart_group')} / ${t('chart.dimension')}`,
|
||||||
limit: 1,
|
type: 'd',
|
||||||
type: 'q'
|
limit: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -706,10 +709,10 @@ export class StackColumnLineMix extends ColumnLineMix {
|
|||||||
}
|
}
|
||||||
axisConfig = {
|
axisConfig = {
|
||||||
...this['axisConfig'],
|
...this['axisConfig'],
|
||||||
yAxis: {
|
extStack: {
|
||||||
name: `${t('chart.drag_block_value_axis_left')} / ${t('chart.column_quota')}`,
|
name: `${t('chart.stack_item')} / ${t('chart.dimension')}`,
|
||||||
limit: 1,
|
type: 'd',
|
||||||
type: 'q'
|
limit: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user