From d2440e1074cf9c7946609f234f1223829c8362a1 Mon Sep 17 00:00:00 2001 From: richie Date: Mon, 22 Feb 2016 14:09:13 +0800 Subject: [PATCH] =?UTF-8?q?echarts=E5=9F=BA=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/echarts/common/glyph/EChartsTitleGlyph.java | 2 +- .../plugin/chart/echarts/common/title/EChartsTitle.java | 5 ++++- .../plugin/chart/echarts/common/ui/EChartsTitlePane.java | 6 ++---- .../ui/data/AbstractEChartsReportDataContentPane.java | 4 ++++ .../fr/solution/plugin/chart/echarts/pie/EChartsPieUI.java | 2 +- .../echarts/pie/ui/EChartsPieReportDataContentPane.java | 5 +++++ 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/com/fr/solution/plugin/chart/echarts/common/glyph/EChartsTitleGlyph.java b/src/com/fr/solution/plugin/chart/echarts/common/glyph/EChartsTitleGlyph.java index 674900e..b07d04d 100644 --- a/src/com/fr/solution/plugin/chart/echarts/common/glyph/EChartsTitleGlyph.java +++ b/src/com/fr/solution/plugin/chart/echarts/common/glyph/EChartsTitleGlyph.java @@ -24,7 +24,7 @@ public class EChartsTitleGlyph extends TitleGlyph { JSONObject t = JSONObject.create() .put("text", getText()) .put("x", "center"); - + t.put("show", isVisible()); return t; } } \ No newline at end of file diff --git a/src/com/fr/solution/plugin/chart/echarts/common/title/EChartsTitle.java b/src/com/fr/solution/plugin/chart/echarts/common/title/EChartsTitle.java index 65a318c..501f3de 100644 --- a/src/com/fr/solution/plugin/chart/echarts/common/title/EChartsTitle.java +++ b/src/com/fr/solution/plugin/chart/echarts/common/title/EChartsTitle.java @@ -4,6 +4,7 @@ import com.fr.base.Formula; import com.fr.base.Utils; import com.fr.chart.chartattr.Title; import com.fr.general.GeneralUtils; +import com.fr.solution.plugin.chart.echarts.common.glyph.EChartsGlyph; import com.fr.solution.plugin.chart.echarts.common.glyph.EChartsTitleGlyph; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; @@ -27,7 +28,9 @@ public class EChartsTitle extends Title { } else { text4Glyph = GeneralUtils.objectToString(text); } - return new EChartsTitleGlyph(text4Glyph); + EChartsTitleGlyph titleGlyph = new EChartsTitleGlyph(text4Glyph); + titleGlyph.setVisible(isTitleVisible()); + return titleGlyph; } @Override diff --git a/src/com/fr/solution/plugin/chart/echarts/common/ui/EChartsTitlePane.java b/src/com/fr/solution/plugin/chart/echarts/common/ui/EChartsTitlePane.java index dbd1430..5fb0dbf 100644 --- a/src/com/fr/solution/plugin/chart/echarts/common/ui/EChartsTitlePane.java +++ b/src/com/fr/solution/plugin/chart/echarts/common/ui/EChartsTitlePane.java @@ -72,10 +72,8 @@ public class EChartsTitlePane extends BasicScrollPane { if (ob == null) { ob = new ECharts(); } - EChartsTitle title = (EChartsTitle) ob.getTitle(); - if (title == null) { - title = new EChartsTitle(); - } + EChartsTitle title = new EChartsTitle(); + ob.setTitle(title); title.setTitleVisible(showTitle.getSelectedItem()); String titleString = tinyFormulaPane.updateBean(); Object titleObj; diff --git a/src/com/fr/solution/plugin/chart/echarts/common/ui/data/AbstractEChartsReportDataContentPane.java b/src/com/fr/solution/plugin/chart/echarts/common/ui/data/AbstractEChartsReportDataContentPane.java index dd6ca4a..5e64acd 100644 --- a/src/com/fr/solution/plugin/chart/echarts/common/ui/data/AbstractEChartsReportDataContentPane.java +++ b/src/com/fr/solution/plugin/chart/echarts/common/ui/data/AbstractEChartsReportDataContentPane.java @@ -1,5 +1,6 @@ package com.fr.solution.plugin.chart.echarts.common.ui.data; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane; /** @@ -7,4 +8,7 @@ import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataConte */ public class AbstractEChartsReportDataContentPane extends CategoryPlotReportDataContentPane { + public AbstractEChartsReportDataContentPane(ChartDataPane parent) { + super(parent); + } } diff --git a/src/com/fr/solution/plugin/chart/echarts/pie/EChartsPieUI.java b/src/com/fr/solution/plugin/chart/echarts/pie/EChartsPieUI.java index 9ffc60c..952eebe 100644 --- a/src/com/fr/solution/plugin/chart/echarts/pie/EChartsPieUI.java +++ b/src/com/fr/solution/plugin/chart/echarts/pie/EChartsPieUI.java @@ -27,7 +27,7 @@ public class EChartsPieUI extends AbstractIndependentEChartsUI { @Override public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { - return new EChartsPieReportDataContentPane(); + return new EChartsPieReportDataContentPane(parent); } @Override diff --git a/src/com/fr/solution/plugin/chart/echarts/pie/ui/EChartsPieReportDataContentPane.java b/src/com/fr/solution/plugin/chart/echarts/pie/ui/EChartsPieReportDataContentPane.java index 5b81b3b..01d0b49 100644 --- a/src/com/fr/solution/plugin/chart/echarts/pie/ui/EChartsPieReportDataContentPane.java +++ b/src/com/fr/solution/plugin/chart/echarts/pie/ui/EChartsPieReportDataContentPane.java @@ -1,9 +1,14 @@ package com.fr.solution.plugin.chart.echarts.pie.ui; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.solution.plugin.chart.echarts.common.ui.data.AbstractEChartsReportDataContentPane; /** * Created by richie on 16/2/18. */ public class EChartsPieReportDataContentPane extends AbstractEChartsReportDataContentPane { + + public EChartsPieReportDataContentPane(ChartDataPane parent) { + super(parent); + } }