diff --git a/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java index bb63ac805a..9ff8fd28cc 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java @@ -3,6 +3,8 @@ package com.fr.design.chartx; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.CustomChartDataDefinition; +import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.GaugeDataSetFieldsPane; import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane; import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane; import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane; @@ -86,8 +88,7 @@ public class CustomChartDataPane extends ChartDataPane { case RING: case SLOT: case CUVETTE: - //todo 仪表板没写好 - return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()); + return new SingleDataPane(new GaugeDataSetFieldsPane(), new GaugeCellDataFieldsPane()); case SCATTER: case BUBBLE: return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java index a00423ad7f..1dd5a9d39c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java @@ -3,6 +3,9 @@ package com.fr.van.chart.bubble; 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.field.diff.BubbleColumnFieldCollection; +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.ScatterCellDataFieldsPane; @@ -143,6 +146,22 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh super.populate(collection); } + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null) { + if (plot != null && plot.isForceBubble()) { + if (!(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)) { + dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection()); + } + } else { + if (!(dataDefinition.getColumnFieldCollection() instanceof BubbleColumnFieldCollection)) { + dataDefinition.setColumnFieldCollection(new BubbleColumnFieldCollection()); + } + } + } + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { if (plot != null && plot.isForceBubble()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java index c45aa17c35..b5bfe7c708 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/FunnelIndependentVanChartInterface.java @@ -2,6 +2,8 @@ package com.fr.van.chart.funnel.designer; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.field.diff.ColumnFieldCollectionWithSeriesValue; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.fields.diff.FunnelCellDataFieldsPane; @@ -97,6 +99,15 @@ public class FunnelIndependentVanChartInterface extends AbstractIndependentVanCh @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof ColumnFieldCollectionWithSeriesValue)){ + dataDefinition.setColumnFieldCollection(new ColumnFieldCollectionWithSeriesValue()); + } + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { return new SingleDataPane(new FunnelDataSetFieldsPane(), new FunnelCellDataFieldsPane()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java index d19ea6a466..6641ba3b3e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/GaugeIndependentVanChartInterface.java @@ -2,6 +2,9 @@ package com.fr.van.chart.gauge; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.field.diff.GaugeColumnFieldCollection; +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.GaugeCellDataFieldsPane; @@ -136,6 +139,23 @@ public class GaugeIndependentVanChartInterface extends AbstractIndependentVanCha super.populate(collection); } + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null) { + if (gaugePlot != null && !gaugePlot.isMultiPointer()) { + if (!(dataDefinition.getColumnFieldCollection() instanceof GaugeColumnFieldCollection)){ + dataDefinition.setColumnFieldCollection(new GaugeColumnFieldCollection()); + } + } else{ + if (!(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)){ + dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection()); + } + } + } + + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { if (gaugePlot != null && !gaugePlot.isMultiPointer()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java index 2652c3074b..865af7e818 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java @@ -50,7 +50,7 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan @Override protected void populate(AbstractDataDefinition dataDefinition) { - if (!(dataDefinition.getColumnFieldCollection() instanceof MultiPieColumnFieldCollection)) { + if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof MultiPieColumnFieldCollection)) { dataDefinition.setColumnFieldCollection(new MultiPieColumnFieldCollection()); } super.populate(dataDefinition); diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java index 7d3a7df481..9182800b0f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java @@ -3,6 +3,8 @@ package com.fr.van.chart.scatter; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.fields.diff.ScatterCellDataFieldsPane; @@ -111,6 +113,15 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof BubbleColumnFieldCollection)) { + dataDefinition.setColumnFieldCollection(new BubbleColumnFieldCollection()); + } + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java index 19f5abd5a4..e213f5914e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/VanStructureChartTypeUI.java @@ -2,6 +2,8 @@ package com.fr.van.chart.structure.desinger; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.field.diff.StructureColumnFieldCollection; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane; @@ -106,6 +108,16 @@ public class VanStructureChartTypeUI extends AbstractIndependentVanChartUI { @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof StructureColumnFieldCollection)) { + dataDefinition.setColumnFieldCollection(new StructureColumnFieldCollection()); + } + + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java index 39e22492f4..2ebd1aafaf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java +++ b/designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractIndependentVanChartUI.java @@ -1,6 +1,8 @@ package com.fr.van.chart.vanchart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; import com.fr.design.chart.fun.impl.AbstractIndependentChartUIWithAPILevel; import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.fields.diff.SingleCategoryCellDataFieldsPane; @@ -54,6 +56,15 @@ public abstract class AbstractIndependentVanChartUI extends AbstractIndependentC @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)) { + dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection()); + } + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()); 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 6cd2743fef..a06b8ee7db 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 @@ -2,6 +2,8 @@ package com.fr.van.chart.vanchart; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +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; @@ -68,6 +70,15 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependen @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof MultiCategoryColumnFieldCollection)) { + dataDefinition.setColumnFieldCollection(new MultiCategoryColumnFieldCollection()); + } + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java index 2e1056ae89..8e7ca2070e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java @@ -2,6 +2,8 @@ package com.fr.van.chart.wordcloud.designer; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.field.diff.WordCloudColumnFieldCollection; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chartx.AbstractVanSingleDataPane; import com.fr.design.chartx.fields.diff.WordCloudCellDataFieldsPane; @@ -115,6 +117,16 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { return new AbstractVanSingleDataPane(listener) { + + @Override + protected void populate(AbstractDataDefinition dataDefinition) { + if (dataDefinition != null && !(dataDefinition.getColumnFieldCollection() instanceof WordCloudColumnFieldCollection)){ + dataDefinition.setColumnFieldCollection(new WordCloudColumnFieldCollection()); + } + + super.populate(dataDefinition); + } + @Override protected SingleDataPane createSingleDataPane() { return new SingleDataPane(new WordCloudDataSetFieldsPane(), new WordCloudCellDataFieldsPane());