Browse Source

CHART-20674 分类轴切换不影响网格线

fix-lag
白岳 3 years ago
parent
commit
3d75cedccf
  1. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

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

@ -1,9 +1,10 @@
package com.fr.van.chart.designer.style.axis;
import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.chart.chartattr.Axis;
import com.fr.design.i18n.Toolkit;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -16,9 +17,9 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
/**
* 带有坐标轴类型选择控件可选类型分类时间数值
@ -98,11 +99,13 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
public VanChartAxis update(VanChartAxis axis) {
int index = axisTypePane.getSelectedIndex();
ColorWithThemeStyle mainGridColorWithPreStyle = axis.getMainGridColorWithPreStyle();
if(ComparatorUtils.equals(index, AxisType.AXIS_CATEGORY.ordinal())){
if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){
textAxisPane.updateBean(axis);
} else {
axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
textAxisPane.updateBean(axis);
}
} else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){
@ -110,6 +113,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
timeAxisPane.updateBean(axis);
} else {
axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
timeAxisPane.updateBean(axis);
}
} else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){
@ -117,6 +121,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
valueAxisPane.updateBean(axis);
} else {
axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor());
axis.setMainGridColorWithPreStyle(mainGridColorWithPreStyle);
valueAxisPane.updateBean(axis);
}
}

Loading…
Cancel
Save