Browse Source

CHART-19488 日期轴的日期控件构建成字符串公式

feature/10.0
白岳 3 years ago
parent
commit
d1e2aa982b
  1. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java

@ -293,7 +293,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
DateEditor dateEditor = (DateEditor)minValueField.getCurrentEditor();
String dateString = dateEditor.getUIDatePickerFormat().format(datetmp);
timeAxis.setCustomMinValue(StringUtils.isNotEmpty(dateString));
timeAxis.setMinValue(BaseFormula.createFormulaBuilder().build(dateString));
timeAxis.setMinValue(createDataFormula(dateString));
}
} else {
timeAxis.setCustomMinValue(false);
@ -308,7 +308,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
DateEditor dateEditor = (DateEditor)maxValueField.getCurrentEditor();
String dateString = dateEditor.getUIDatePickerFormat().format(datetmp);
timeAxis.setCustomMaxValue(StringUtils.isNotEmpty(dateString));
timeAxis.setMaxValue(BaseFormula.createFormulaBuilder().build(dateString));
timeAxis.setMaxValue(createDataFormula(dateString));
}
} else {
timeAxis.setCustomMaxValue(false);
@ -332,6 +332,11 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
checkBoxUse();
}
private BaseFormula createDataFormula(String dateString) {
String formulaString = "\"" + dateString + "\"";
return BaseFormula.createFormulaBuilder().build(formulaString);
}
public void populate(VanChartTimeAxis timeAxis){
// 最小值
if (timeAxis.isCustomMinValue() && timeAxis.getMinValue() != null) {

Loading…
Cancel
Save