Browse Source

CHART-20951 fix:大屏模板中的图表 警戒线文字默认样式

zheng-1641779399395
shine 3 years ago
parent
commit
0210104f7c
  1. 2
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java
  2. 8
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  3. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java

2
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java

@ -26,6 +26,8 @@ public class DefaultStyleConstants {
static final Color AXIS_LINE = new Color(46, 75, 102);
static final Color GRID_LINE = new Color(30, 55, 78);
static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(255, 0, 0));
static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191));
static final Color DATA_SHEET_BORDER = new Color(46, 75, 102);

8
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -9,6 +9,7 @@ import com.fr.chart.chartglyph.DataSheet;
import com.fr.config.predefined.ColorFillStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
@ -69,6 +70,13 @@ public class DefaultStyleHelper4Van {
return axis;
}
public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) {
if (!ChartEditContext.duchampMode()) {
return;
}
vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT);
}
static void dealVanPlotCommonAttr(Plot plot) {
if (!ChartEditContext.duchampMode()) {
return;

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java

@ -3,10 +3,11 @@ package com.fr.van.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.stable.Nameable;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@ -37,6 +38,7 @@ public class ChartNameObjectCreator extends NameObjectCreator {
VanChartAlertValue vanChartAlertValue = constructor.newInstance();
vanChartAlertValue.setAxisNamesArray((String[]) object);
vanChartAlertValue.setAxisName(((String[]) object)[0]);
DefaultStyleHelper4Van.dealAxisAlert(vanChartAlertValue);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue);
} catch (NoSuchMethodException e) {

Loading…
Cancel
Save