From 65b2c1635851e40c7ed1d8a0c3b87304268a8689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 2 Dec 2019 16:29:29 +0800 Subject: [PATCH 1/4] =?UTF-8?q?CHART-11265=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=A4=9A=E5=88=86=E7=B1=BB=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=BD=B4=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD=E7=81=B0=E5=8C=96?= =?UTF-8?q?=20&&=20CHART-11446=20=E4=B8=8B=E6=8B=89=E6=A1=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E9=BB=98=E8=AE=A4=E6=97=A0=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E7=B3=BB=E5=88=97=E5=88=A0=E9=99=A4=E4=BA=86?= =?UTF-8?q?=E5=AF=B9=E6=B1=87=E6=80=BB=E6=96=B9=E5=BC=8F=E5=92=8C=E7=B3=BB?= =?UTF-8?q?=E5=88=97=E5=90=8D=E4=BD=BF=E7=94=A8=E7=9A=84=E7=81=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/AbstractVanSingleDataPane.java | 4 ++ .../AbstractCustomFieldComboBoxPane.java | 6 +- .../component/AbstractMultiComponentPane.java | 19 +++++- .../component/AbstractSingleFilterPane.java | 3 +- .../diff/MultiCategoryCellDataFieldsPane.java | 4 +- .../diff/MultiCategoryDataSetFieldsPane.java | 2 + .../fr/design/chartx/single/DataSetPane.java | 3 +- .../design/chartx/single/SingleDataPane.java | 4 ++ .../fr/extended/chart/UIComboBoxWithNone.java | 5 ++ .../AbstractMultiCategoryVanChartUI.java | 64 +++++++++++++++++++ 10 files changed, 103 insertions(+), 11 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java index 1db85d8c5..81d5e953c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java @@ -34,4 +34,8 @@ public abstract class AbstractVanSingleDataPane extends AbstractChartDataPane extends UIComboBoxPane< } public void checkBoxUse(boolean hasUse) { - jcb.setEnabled(hasUse); useFieldValuePane.checkBoxUse(hasUse); } @@ -171,7 +170,6 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< public void checkBoxUse(boolean hasUse) { series.setEnabled(hasUse); value.setEnabled(hasUse); - function.setEnabled(hasUse); } public void clearAllBoxList() { diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java index f82e4b253..7d49dfebb 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java @@ -34,6 +34,7 @@ public abstract class AbstractMultiComponentPane extends J private List categoryComponentList = new ArrayList(); + private boolean isCategoryAxis = true; protected abstract T createFirstFieldComponent(); @@ -43,6 +44,10 @@ public abstract class AbstractMultiComponentPane extends J protected abstract void updateField(T component, ColumnField field); + public void setIsCategoryAxis(boolean isCategoryAxis) { + this.isCategoryAxis = isCategoryAxis; + } + public AbstractMultiComponentPane() { UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category")); @@ -126,7 +131,7 @@ public abstract class AbstractMultiComponentPane extends J } private boolean canAdd() { - return categoryComponentList.size() < 2; + return categoryComponentList.size() < 2 && isCategoryAxis; } public List componentList() { @@ -169,7 +174,15 @@ public abstract class AbstractMultiComponentPane extends J } } - public void checkEnable(boolean hasUse){ - addButton.setEnabled(hasUse); + public void checkEnable(boolean hasUse) { + //增加按钮是否灰化要根据是否选择了数据源,是否分类轴,分类数量是否超标三个判断 + boolean buttonUse = hasUse && isCategoryAxis && categoryComponentList.size() < 2; + //额外的分类是否灰化根据是否选择了数据源,是否分类轴判断 + boolean categoryUse = hasUse && isCategoryAxis; + + addButton.setEnabled(buttonUse); + for (JComponent component : categoryComponentList) { + component.setEnabled(categoryUse); + } } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java index 187dd2547..73a635164 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractSingleFilterPane.java @@ -20,7 +20,6 @@ import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; -import java.awt.Label; /** * Created by shine on 2019/07/18. @@ -110,7 +109,7 @@ public abstract class AbstractSingleFilterPane extends AbstractChartTabPane { this.setLayout(new BorderLayout()); this.add(tableDataPane, BorderLayout.NORTH); this.add(dataSetFieldsPane, BorderLayout.CENTER); - checkBoxUse(); } /** @@ -108,6 +107,8 @@ public class DataSetPane extends FurtherBasicBeanPane { tableDataPane.populateBean(ob.getNameTableData()); dataSetFieldsPane.populateBean(ob.getColumnFieldCollection()); + + checkBoxUse(); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java index dc4dfc65a..1049861b6 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java @@ -89,4 +89,8 @@ public class SingleDataPane extends BasicBeanPane { protected String title4PopupWindow() { return null; } + + public void setSelectedIndex(int index) { + comboBoxPane.setSelectedIndex(index); + } } diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index 77347e0fd..6df855cd7 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -14,6 +14,11 @@ public class UIComboBoxWithNone extends UIComboBox { return Toolkit.i18nText("Fine-Design_Chart_Use_None"); } + public UIComboBoxWithNone() { + super(); + addDefaultItem(); + } + @Override public void refreshBoxItems(List list) { super.refreshBoxItems(list); diff --git a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java index 6cd2743fe..ae924b448 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java +++ b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java @@ -1,7 +1,13 @@ package com.fr.van.chart.vanchart; import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.CellDataDefinition; +import com.fr.chartx.data.ChartDataDefinitionProvider; +import com.fr.chartx.data.DataSetDefinition; +import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane; @@ -14,7 +20,13 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane; +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.type.AxisType; +import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.data.VanChartMoreCateReportDataContentPane; import com.fr.van.chart.designer.data.VanChartMoreCateTableDataContentPane; import com.fr.van.chart.designer.other.VanChartInteractivePane; @@ -72,6 +84,58 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen protected SingleDataPane createSingleDataPane() { return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); } + + @Override + public void populate(ChartCollection collection) { + if (collection == null) { + return; + } + VanChart vanChart = collection.getSelectedChartProvider(VanChart.class); + if (vanChart == null) { + return; + } + + VanChartRectanglePlot plot = vanChart.getPlot(); + VanChartAxis axis = plot.getDefaultXAxis(); + if (plot instanceof VanChartColumnPlot + && ((VanChartColumnPlot) plot).isBar()) { + axis = plot.getDefaultYAxis(); + } + + boolean isCategoryAxis = ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY); + MultiCategoryColumnFieldCollection multiCategoryColumnFieldCollection = new MultiCategoryColumnFieldCollection(); + multiCategoryColumnFieldCollection.setCategoryAxis(isCategoryAxis); + + //如果DataDefinition为空,对数据集数据源配置面板和单元格数据源配置面板进行更新。 + ChartDataDefinitionProvider definition = vanChart.getChartDataDefinition(); + if (definition == null) { + CellDataDefinition cellDataDefinition = new CellDataDefinition(); + cellDataDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); + populate(cellDataDefinition); + + DataSetDefinition dataSetDefinition = new DataSetDefinition(); + dataSetDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); + populate(dataSetDefinition); + return; + } + + MultiCategoryColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection(MultiCategoryColumnFieldCollection.class); + columnFieldCollection.setCategoryAxis(isCategoryAxis); + super.populate(collection); + + //如果DataDefinition不为空,对另一种数据源配置进行更新 + if (definition instanceof DataSetDefinition) { + CellDataDefinition cellDataDefinition = new CellDataDefinition(); + cellDataDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); + populate(cellDataDefinition); + setSelectedIndex(0); + } else { + DataSetDefinition dataSetDefinition = new DataSetDefinition(); + dataSetDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); + populate(dataSetDefinition); + setSelectedIndex(1); + } + } }; } } From e57e78308759f69aceda77f1d4064f62ca9e37c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 2 Dec 2019 16:48:09 +0800 Subject: [PATCH 2/4] CHART-11265 --- .../chartx/component/AbstractCustomFieldComboBoxPane.java | 1 + .../src/main/java/com/fr/design/chartx/single/DataSetPane.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java index e2d7d9fdb..4012366a3 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java @@ -106,6 +106,7 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< } public void checkBoxUse(boolean hasUse) { + jcb.setEnabled(hasUse); useFieldValuePane.checkBoxUse(hasUse); } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index 99bf1339e..87a3b5083 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -50,6 +50,7 @@ public class DataSetPane extends FurtherBasicBeanPane { this.setLayout(new BorderLayout()); this.add(tableDataPane, BorderLayout.NORTH); this.add(dataSetFieldsPane, BorderLayout.CENTER); + checkBoxUse(); } /** @@ -102,7 +103,6 @@ public class DataSetPane extends FurtherBasicBeanPane { } refreshBoxList(); - checkBoxUse(); tableDataPane.populateBean(ob.getNameTableData()); From f1f33297f90b58e4fc669bb4af62876bdccc8354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 2 Dec 2019 18:22:52 +0800 Subject: [PATCH 3/4] CHART-11265 --- .../chartx/AbstractVanSingleDataPane.java | 4 -- .../component/AbstractMultiComponentPane.java | 18 ++++--- .../diff/MultiCategoryCellDataFieldsPane.java | 6 ++- .../diff/MultiCategoryDataSetFieldsPane.java | 6 ++- .../design/chartx/single/SingleDataPane.java | 4 -- .../AbstractMultiCategoryVanChartUI.java | 48 ++++--------------- 6 files changed, 29 insertions(+), 57 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java index 81d5e953c..1db85d8c5 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/AbstractVanSingleDataPane.java @@ -34,8 +34,4 @@ public abstract class AbstractVanSingleDataPane extends AbstractChartDataPane extends J private List categoryComponentList = new ArrayList(); - private boolean isCategoryAxis = true; + private boolean categoryAxis = true; protected abstract T createFirstFieldComponent(); @@ -44,8 +44,14 @@ public abstract class AbstractMultiComponentPane extends J protected abstract void updateField(T component, ColumnField field); - public void setIsCategoryAxis(boolean isCategoryAxis) { - this.isCategoryAxis = isCategoryAxis; + public void setCategoryAxis(boolean categoryAxis) { + this.categoryAxis = categoryAxis; + if(!categoryAxis){ + addButton.setEnabled(false); + for (JComponent component : categoryComponentList) { + component.setEnabled(false); + } + } } public AbstractMultiComponentPane() { @@ -131,7 +137,7 @@ public abstract class AbstractMultiComponentPane extends J } private boolean canAdd() { - return categoryComponentList.size() < 2 && isCategoryAxis; + return categoryComponentList.size() < 2 && categoryAxis; } public List componentList() { @@ -176,9 +182,9 @@ public abstract class AbstractMultiComponentPane extends J public void checkEnable(boolean hasUse) { //增加按钮是否灰化要根据是否选择了数据源,是否分类轴,分类数量是否超标三个判断 - boolean buttonUse = hasUse && isCategoryAxis && categoryComponentList.size() < 2; + boolean buttonUse = hasUse && categoryAxis && categoryComponentList.size() < 2; //额外的分类是否灰化根据是否选择了数据源,是否分类轴判断 - boolean categoryUse = hasUse && isCategoryAxis; + boolean categoryUse = hasUse && categoryAxis; addButton.setEnabled(buttonUse); for (JComponent component : categoryComponentList) { diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java index 12ba42343..505721d18 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryCellDataFieldsPane.java @@ -53,8 +53,6 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS multiCategoryPane.populate(categoryList); - multiCategoryPane.setIsCategoryAxis(multiCategoryColumnFieldCollection.isCategoryAxis()); - populateSeriesValuePane(multiCategoryColumnFieldCollection); filterPane.populateMultiCategoryFieldCollection(multiCategoryColumnFieldCollection); @@ -74,4 +72,8 @@ public class MultiCategoryCellDataFieldsPane extends AbstractCellDataFieldsWithS return fieldCollection; } + + public void setCategoryAxis(boolean categoryAxis){ + multiCategoryPane.setCategoryAxis(categoryAxis); + } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java index 7f0313579..cba3807a9 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java @@ -67,8 +67,6 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer multiCategoryPane.populate(categoryList); - multiCategoryPane.setIsCategoryAxis(multiCategoryColumnFieldCollection.isCategoryAxis()); - populateSeriesValuePane(multiCategoryColumnFieldCollection); filterPane.populateMultiCategoryFieldCollection(multiCategoryColumnFieldCollection); @@ -88,4 +86,8 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer return columnFieldCollection; } + + public void setCategoryAxis(boolean categoryAxis){ + multiCategoryPane.setCategoryAxis(categoryAxis); + } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java index 1049861b6..dc4dfc65a 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java @@ -89,8 +89,4 @@ public class SingleDataPane extends BasicBeanPane { protected String title4PopupWindow() { return null; } - - public void setSelectedIndex(int index) { - comboBoxPane.setSelectedIndex(index); - } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java index ae924b448..05f5eb647 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java +++ b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java @@ -3,11 +3,6 @@ package com.fr.van.chart.vanchart; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; -import com.fr.chartx.data.AbstractDataDefinition; -import com.fr.chartx.data.CellDataDefinition; -import com.fr.chartx.data.ChartDataDefinitionProvider; -import com.fr.chartx.data.DataSetDefinition; -import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane; @@ -80,13 +75,19 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + MultiCategoryDataSetFieldsPane multiCategoryDataSetFieldsPane; + MultiCategoryCellDataFieldsPane multiCategoryCellDataFieldsPane; + @Override protected SingleDataPane createSingleDataPane() { - return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); + multiCategoryDataSetFieldsPane = new MultiCategoryDataSetFieldsPane(); + multiCategoryCellDataFieldsPane = new MultiCategoryCellDataFieldsPane(); + return new SingleDataPane(multiCategoryDataSetFieldsPane, multiCategoryCellDataFieldsPane); } @Override public void populate(ChartCollection collection) { + super.populate(collection); if (collection == null) { return; } @@ -102,39 +103,8 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen axis = plot.getDefaultYAxis(); } - boolean isCategoryAxis = ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY); - MultiCategoryColumnFieldCollection multiCategoryColumnFieldCollection = new MultiCategoryColumnFieldCollection(); - multiCategoryColumnFieldCollection.setCategoryAxis(isCategoryAxis); - - //如果DataDefinition为空,对数据集数据源配置面板和单元格数据源配置面板进行更新。 - ChartDataDefinitionProvider definition = vanChart.getChartDataDefinition(); - if (definition == null) { - CellDataDefinition cellDataDefinition = new CellDataDefinition(); - cellDataDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); - populate(cellDataDefinition); - - DataSetDefinition dataSetDefinition = new DataSetDefinition(); - dataSetDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); - populate(dataSetDefinition); - return; - } - - MultiCategoryColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection(MultiCategoryColumnFieldCollection.class); - columnFieldCollection.setCategoryAxis(isCategoryAxis); - super.populate(collection); - - //如果DataDefinition不为空,对另一种数据源配置进行更新 - if (definition instanceof DataSetDefinition) { - CellDataDefinition cellDataDefinition = new CellDataDefinition(); - cellDataDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); - populate(cellDataDefinition); - setSelectedIndex(0); - } else { - DataSetDefinition dataSetDefinition = new DataSetDefinition(); - dataSetDefinition.setColumnFieldCollection(multiCategoryColumnFieldCollection); - populate(dataSetDefinition); - setSelectedIndex(1); - } + multiCategoryDataSetFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)); + multiCategoryCellDataFieldsPane.setCategoryAxis(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)); } }; } From dae083df05923e34670ae74bdf4f0c92f560e9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 2 Dec 2019 18:29:22 +0800 Subject: [PATCH 4/4] CHART-11265 --- .../van/chart/vanchart/AbstractMultiCategoryVanChartUI.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java index 05f5eb647..3aec1f671 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java +++ b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java @@ -88,10 +88,7 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen @Override public void populate(ChartCollection collection) { super.populate(collection); - if (collection == null) { - return; - } - VanChart vanChart = collection.getSelectedChartProvider(VanChart.class); + VanChart vanChart = this.getVanChart(); if (vanChart == null) { return; }