From 833c4b58725725af873ff7252ae249a93507e599 Mon Sep 17 00:00:00 2001 From: shine Date: Fri, 15 Apr 2022 15:20:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-68638=20fix:=E5=88=A0=E9=99=A4=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=9B=BE=E8=A1=A8=E9=85=8D=E8=89=B2=20=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=AF=BBfvs.cpt.chart=E4=BC=9A=E8=A2=AB=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=88=90=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/config/DefaultStyleHelper4Van.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java index a6ce45a53..356fbe854 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java +++ b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java @@ -27,6 +27,7 @@ import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.vanchart.VanChart; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -166,8 +167,8 @@ public class DefaultStyleHelper4Van { private static void dealChartColor(VanChartPlot vanChartPlot) { ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS); + ColorFillStyle colorFillStyle = new ColorFillStyle(); if (preStyle instanceof ChartColorMatching) { - ColorFillStyle colorFillStyle = new ColorFillStyle(); //default是默认的意思,为服务器默认配色方案 //acc为多个颜色组合 //gradient为渐变颜色 @@ -181,7 +182,20 @@ public class DefaultStyleHelper4Van { vanChartPlot.setPlotFillStyle(plotFillStyle); } plotFillStyle.setColorFillStyle(colorFillStyle); + } else { + //服务器上没有图表配色 + //需要指定配色属性为自定义组合色,否则会被兼容成跟随主题 + // com.fr.plugin.chart.attr.plot.VanChartPlot.compatibleFillStyle + colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); + colorFillStyle.setColorList(Arrays.asList(ChartConstants.NEW_FEATURES)); + } + + AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); + if (plotFillStyle == null) { + plotFillStyle = new AttrFillStyle(); + vanChartPlot.setPlotFillStyle(plotFillStyle); } + plotFillStyle.setColorFillStyle(colorFillStyle); } private static void dealBorder(VanChartPlot vanChartPlot) {