obo
12 months ago
4 changed files with 70 additions and 95 deletions
@ -0,0 +1,54 @@
|
||||
package com.fr.widgettheme.util; |
||||
|
||||
import com.fr.base.BaseFormula; |
||||
import com.fr.chart.chartattr.Title; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
||||
import com.fr.plugin.chart.base.AttrLabel; |
||||
import com.fr.plugin.chart.base.VanChartTools; |
||||
import com.fr.plugin.chart.column.VanChartColumnPlot; |
||||
import com.fr.plugin.chart.type.GradientType; |
||||
|
||||
/** |
||||
* 辅助report和form的控件显示主题预览窗口做初始化工作 |
||||
* 没有其他的用途,不要用在其他的地方,只是抽一些方法出来,降低复杂度 |
||||
* |
||||
* @author obo |
||||
* @since 11.0 |
||||
* Created on 2023/11/14 |
||||
*/ |
||||
public class ThemePreviewPaneInitHelper { |
||||
private ThemePreviewPaneInitHelper() { |
||||
} |
||||
|
||||
public static void initVanChartsTools(VanChartTools vanChartTools) { |
||||
vanChartTools.setSort(false); |
||||
vanChartTools.setExport(false); |
||||
vanChartTools.setFullScreen(false); |
||||
} |
||||
|
||||
public static void initPlot(VanChartColumnPlot plot) { |
||||
AttrLabel defaultAttrLabel = plot.getDefaultAttrLabel(); |
||||
defaultAttrLabel.setEnable(true); |
||||
defaultAttrLabel.getAttrLabelDetail().getBorder().setBorderStyle(0); |
||||
defaultAttrLabel.getAttrLabelDetail().getBackground().setBackground(null); |
||||
plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel); |
||||
plot.getGradientStyle().setGradientType(GradientType.NONE); |
||||
plot.setSeriesOverlapPercent(30); |
||||
plot.setCategoryIntervalPercent(30); |
||||
} |
||||
public static void initVanChartYAxis(VanChartAxis yAxis) { |
||||
Title title = new Title(); |
||||
title.setTextObject(Toolkit.i18nText("Fine-Design_Chart_Axis_Title")); |
||||
title.getTextAttr().setRotation(-90); |
||||
title.getTextAttr().setThemed(true); |
||||
yAxis.setTitle(title); |
||||
yAxis.setShowAxisTitle(true); |
||||
yAxis.setCustomMaxValue(true); |
||||
yAxis.setCustomMinValue(true); |
||||
yAxis.setCustomMainUnit(true); |
||||
yAxis.setMaxValue(BaseFormula.createFormulaBuilder().build("=600")); |
||||
yAxis.setMinValue(BaseFormula.createFormulaBuilder().build("=0")); |
||||
yAxis.setMainUnit(BaseFormula.createFormulaBuilder().build("=200")); |
||||
} |
||||
} |
Loading…
Reference in new issue