You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.4 KiB
71 lines
2.4 KiB
1 year ago
|
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() {
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 初始化图表工具
|
||
|
*
|
||
|
* @param vanChartTools 图表工具
|
||
|
*/
|
||
|
public static void initVanChartsTools(VanChartTools vanChartTools) {
|
||
|
vanChartTools.setSort(false);
|
||
|
vanChartTools.setExport(false);
|
||
|
vanChartTools.setFullScreen(false);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 初始化柱形图绘图区
|
||
|
*
|
||
|
* @param plot 绘图区
|
||
|
*/
|
||
|
public static void initColumnPlot(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);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 初始化图表Y轴
|
||
|
*
|
||
|
* @param yAxis 轴
|
||
|
*/
|
||
|
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"));
|
||
|
}
|
||
|
}
|