Browse Source

Pull request #2270: CHART-15664 雷达图饼图继承多分类的问题

Merge in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '871c3954afe7d696efecaa89fc5f5c4237b8b777':
  CHART-15664 雷达图饼图继承多分类的问题
feature/big-screen
Bjorn 4 years ago
parent
commit
dfebbc0d50
  1. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  2. 5
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java
  3. 4
      designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarPlotPane.java

19
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -1,10 +1,13 @@
package com.fr.van.chart.designer.type; package com.fr.van.chart.designer.type;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Legend; import com.fr.chart.chartattr.Legend;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chart.chartglyph.DataSheet; import com.fr.chart.chartglyph.DataSheet;
@ -167,6 +170,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
} }
protected void resetChartAttr(VanChart chart, VanChartPlot newPlot) { protected void resetChartAttr(VanChart chart, VanChartPlot newPlot) {
resetFilterDefinition(chart);
//上个图表支持继承部分属性到新图表 //上个图表支持继承部分属性到新图表
if (supportExtendAttr(chart)) { if (supportExtendAttr(chart)) {
newPlot.extendAttribute(chart); newPlot.extendAttribute(chart);
@ -186,8 +190,6 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
resetTitleAttr(chart); resetTitleAttr(chart);
//重置监控刷新选项 //重置监控刷新选项
resetRefreshMoreLabelAttr(chart); resetRefreshMoreLabelAttr(chart);
resetFilterDefinition(chart);
} }
//是否支持属性的继承 //是否支持属性的继承
@ -290,4 +292,17 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
autoButton.addActionListener(autoButtonListener); autoButton.addActionListener(autoButtonListener);
} }
} }
//部分图表继承到多分类之后会报错
protected void resetMoreCateDefinition(Chart chart) {
TopDefinitionProvider filterDefinition = chart.getFilterDefinition();
if (filterDefinition instanceof NormalTableDataDefinition) {
((NormalTableDataDefinition) filterDefinition).clearMoreCate();
((VanChartPlot) chart.getPlot()).setCategoryNum(1);
}
if (filterDefinition instanceof NormalReportDataDefinition) {
((NormalReportDataDefinition) filterDefinition).clearMoreCate();
((VanChartPlot) chart.getPlot()).setCategoryNum(1);
}
}
} }

5
designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java

@ -83,4 +83,9 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane {
public Chart getDefaultChart() { public Chart getDefaultChart() {
return PieIndependentVanChart.newPieChartTypes[0]; return PieIndependentVanChart.newPieChartTypes[0];
} }
//重置数据配置
protected void resetFilterDefinition(Chart chart) {
resetMoreCateDefinition(chart);
}
} }

4
designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarPlotPane.java

@ -49,4 +49,8 @@ public class VanChartRadarPlotPane extends AbstractVanChartTypePane {
return RadarIndependentVanChart.RadarVanChartTypes[0]; return RadarIndependentVanChart.RadarVanChartTypes[0];
} }
//重置数据配置
protected void resetFilterDefinition(Chart chart) {
resetMoreCateDefinition(chart);
}
} }
Loading…
Cancel
Save