|
|
@ -129,38 +129,7 @@ public class WidgetDisplayFormThemePreviewPane extends TemplateThemePreviewPane< |
|
|
|
private ChartCollection initColumnChart() { |
|
|
|
private ChartCollection initColumnChart() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
VanChart chart = (VanChart) ChartTypeManager.getInstance().getCharts(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID)[0].clone(); |
|
|
|
VanChart chart = (VanChart) ChartTypeManager.getInstance().getCharts(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID)[0].clone(); |
|
|
|
chart.getTitle().setTitleVisible(false); |
|
|
|
initChart(chart); |
|
|
|
VanChartTools vanChartTools = chart.getVanChartTools(); |
|
|
|
|
|
|
|
vanChartTools.setSort(false); |
|
|
|
|
|
|
|
vanChartTools.setExport(false); |
|
|
|
|
|
|
|
vanChartTools.setFullScreen(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VanChartColumnPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
AttrLabel defaultAttrLabel = plot.getDefaultAttrLabel(); |
|
|
|
|
|
|
|
defaultAttrLabel.setEnable(true); |
|
|
|
|
|
|
|
defaultAttrLabel.getAttrLabelDetail().getBorder().setBorderStyle(0); |
|
|
|
|
|
|
|
defaultAttrLabel.getAttrLabelDetail().getBackground().setBackground(null); |
|
|
|
|
|
|
|
plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot.getLegend().setPosition(Constants.TOP); |
|
|
|
|
|
|
|
plot.getGradientStyle().setGradientType(GradientType.NONE); |
|
|
|
|
|
|
|
plot.setSeriesOverlapPercent(30); |
|
|
|
|
|
|
|
plot.setCategoryIntervalPercent(30); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VanChartAxis defaultYAxis = plot.getDefaultYAxis(); |
|
|
|
|
|
|
|
Title title = new Title(); |
|
|
|
|
|
|
|
title.setTextObject(Toolkit.i18nText("Fine-Design_Chart_Axis_Title")); |
|
|
|
|
|
|
|
title.getTextAttr().setRotation(-90); |
|
|
|
|
|
|
|
title.getTextAttr().setThemed(true); |
|
|
|
|
|
|
|
defaultYAxis.setTitle(title); |
|
|
|
|
|
|
|
defaultYAxis.setShowAxisTitle(true); |
|
|
|
|
|
|
|
defaultYAxis.setCustomMaxValue(true); |
|
|
|
|
|
|
|
defaultYAxis.setCustomMinValue(true); |
|
|
|
|
|
|
|
defaultYAxis.setCustomMainUnit(true); |
|
|
|
|
|
|
|
defaultYAxis.setMaxValue(BaseFormula.createFormulaBuilder().build("=600")); |
|
|
|
|
|
|
|
defaultYAxis.setMinValue(BaseFormula.createFormulaBuilder().build("=0")); |
|
|
|
|
|
|
|
defaultYAxis.setMainUnit(BaseFormula.createFormulaBuilder().build("=200")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object[] category = { |
|
|
|
Object[] category = { |
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Category") + "1", |
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Category") + "1", |
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Category") + "2", |
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Category") + "2", |
|
|
@ -185,6 +154,47 @@ public class WidgetDisplayFormThemePreviewPane extends TemplateThemePreviewPane< |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initChart(VanChart chart) { |
|
|
|
|
|
|
|
chart.getTitle().setTitleVisible(false); |
|
|
|
|
|
|
|
initVanChartsTools(chart.getVanChartTools()); |
|
|
|
|
|
|
|
VanChartColumnPlot plot = chart.getPlot(); |
|
|
|
|
|
|
|
AttrLabel defaultAttrLabel = plot.getDefaultAttrLabel(); |
|
|
|
|
|
|
|
initDefaultAttrLabel(defaultAttrLabel); |
|
|
|
|
|
|
|
initPlot(plot); |
|
|
|
|
|
|
|
plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel); |
|
|
|
|
|
|
|
VanChartAxis defaultYAxis = plot.getDefaultYAxis(); |
|
|
|
|
|
|
|
Title title = new Title(); |
|
|
|
|
|
|
|
title.setTextObject(Toolkit.i18nText("Fine-Design_Chart_Axis_Title")); |
|
|
|
|
|
|
|
title.getTextAttr().setRotation(-90); |
|
|
|
|
|
|
|
title.getTextAttr().setThemed(true); |
|
|
|
|
|
|
|
defaultYAxis.setTitle(title); |
|
|
|
|
|
|
|
defaultYAxis.setShowAxisTitle(true); |
|
|
|
|
|
|
|
defaultYAxis.setCustomMaxValue(true); |
|
|
|
|
|
|
|
defaultYAxis.setCustomMinValue(true); |
|
|
|
|
|
|
|
defaultYAxis.setCustomMainUnit(true); |
|
|
|
|
|
|
|
defaultYAxis.setMaxValue(BaseFormula.createFormulaBuilder().build("=600")); |
|
|
|
|
|
|
|
defaultYAxis.setMinValue(BaseFormula.createFormulaBuilder().build("=0")); |
|
|
|
|
|
|
|
defaultYAxis.setMainUnit(BaseFormula.createFormulaBuilder().build("=200")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initVanChartsTools(VanChartTools vanChartTools) { |
|
|
|
|
|
|
|
vanChartTools.setSort(false); |
|
|
|
|
|
|
|
vanChartTools.setExport(false); |
|
|
|
|
|
|
|
vanChartTools.setFullScreen(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initDefaultAttrLabel(AttrLabel defaultAttrLabel) { |
|
|
|
|
|
|
|
defaultAttrLabel.setEnable(true); |
|
|
|
|
|
|
|
defaultAttrLabel.getAttrLabelDetail().getBorder().setBorderStyle(0); |
|
|
|
|
|
|
|
defaultAttrLabel.getAttrLabelDetail().getBackground().setBackground(null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initPlot(VanChartColumnPlot plot) { |
|
|
|
|
|
|
|
plot.getLegend().setPosition(Constants.TOP); |
|
|
|
|
|
|
|
plot.getGradientStyle().setGradientType(GradientType.NONE); |
|
|
|
|
|
|
|
plot.setSeriesOverlapPercent(30); |
|
|
|
|
|
|
|
plot.setCategoryIntervalPercent(30); |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 初始化饼图 |
|
|
|
* 初始化饼图 |
|
|
|
* |
|
|
|
* |
|
|
|