From e062e49a6eb67f61f861024dbd4779a62979b9ed Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 27 Nov 2019 17:34:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1,=20sonar?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chartx/CustomChartDataPane.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java index 9ff8fd28cc..197a1c1c9e 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java @@ -41,6 +41,9 @@ import java.util.Map; */ public class CustomChartDataPane extends ChartDataPane { + private static final int HGAP = 0; + private static final int VGAP = 6; + public CustomChartDataPane(AttributeChangeListener listener) { super(listener); } @@ -93,9 +96,11 @@ public class CustomChartDataPane extends ChartDataPane { case BUBBLE: return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane()); default: - return StringUtils.equals(CustomStyle.CUSTOM.toString(), plot.getCustomType()) ? - new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()) : - new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); + if (StringUtils.equals(CustomStyle.CUSTOM.toString(), plot.getCustomType())){ + return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()); + } else { + return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); + } } } @@ -147,7 +152,7 @@ public class CustomChartDataPane extends ChartDataPane { JPanel tabPanel = new JPanel(new BorderLayout()); tabPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, getBackground())); tabPanel.add(tabPane, BorderLayout.CENTER); - this.setLayout(new BorderLayout(0, 6)); + this.setLayout(new BorderLayout(HGAP, VGAP)); this.add(tabPanel, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); }