diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index acfc7811e1..faa112952d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -337,9 +337,13 @@ public class VanChartPlotLegendPane extends BasicPane { } protected boolean isVisibleLayoutPane() { - int locationIndex = getLegendLocation().getSelectedIndex(); + if (customFloatPositionButton.isSelected()) { + return false; + } + + int locationIntValue = getLegendLocation().getSelectedItem(); - return !getCustomFloatPositionButton().isSelected() && (locationIndex == 0 || locationIndex == 1); + return locationIntValue == Constants.TOP || locationIntValue == Constants.BOTTOM; } //检查显示策略界面是否可用