richie
9 years ago
10 changed files with 128 additions and 35 deletions
@ -1,25 +0,0 @@ |
|||||||
package com.fr.solution.plugin.chart.echarts.base; |
|
||||||
|
|
||||||
import com.fr.base.chart.chartdata.ChartData; |
|
||||||
import com.fr.chart.chartattr.Plot; |
|
||||||
import com.fr.general.ComparatorUtils; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by richie on 16/2/2. |
|
||||||
*/ |
|
||||||
public abstract class NewPlot extends Plot { |
|
||||||
|
|
||||||
public boolean accept(Class<? extends Plot> obClass) { |
|
||||||
return ComparatorUtils.equals(NewPlot.class, obClass); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public NewTitleGlyph createChartTitleGlyph(ChartData chartData) { |
|
||||||
return new NewTitleGlyph("iPhone", "iPhone"); |
|
||||||
} |
|
||||||
|
|
||||||
public NewLegendGlyph createChartLegendGlyph(ChartData chartData) { |
|
||||||
return new NewLegendGlyph(); |
|
||||||
} |
|
||||||
} |
|
@ -1,9 +1,11 @@ |
|||||||
package com.fr.solution.plugin.chart.echarts.base; |
package com.fr.solution.plugin.chart.echarts.glyph; |
||||||
|
|
||||||
import com.fr.chart.chartglyph.ChartGlyph; |
import com.fr.chart.chartglyph.ChartGlyph; |
||||||
import com.fr.json.JSONArray; |
import com.fr.json.JSONArray; |
||||||
import com.fr.json.JSONException; |
import com.fr.json.JSONException; |
||||||
import com.fr.json.JSONObject; |
import com.fr.json.JSONObject; |
||||||
|
import com.fr.solution.plugin.chart.echarts.glyph.NewLegendGlyph; |
||||||
|
import com.fr.solution.plugin.chart.echarts.glyph.NewTitleGlyph; |
||||||
import com.fr.stable.web.Repository; |
import com.fr.stable.web.Repository; |
||||||
|
|
||||||
/** |
/** |
@ -1,4 +1,4 @@ |
|||||||
package com.fr.solution.plugin.chart.echarts.base; |
package com.fr.solution.plugin.chart.echarts.glyph; |
||||||
|
|
||||||
import com.fr.chart.chartglyph.LegendGlyph; |
import com.fr.chart.chartglyph.LegendGlyph; |
||||||
import com.fr.json.JSONArray; |
import com.fr.json.JSONArray; |
@ -1,4 +1,4 @@ |
|||||||
package com.fr.solution.plugin.chart.echarts.base; |
package com.fr.solution.plugin.chart.echarts.glyph; |
||||||
|
|
||||||
import com.fr.chart.chartglyph.ChartGlyph; |
import com.fr.chart.chartglyph.ChartGlyph; |
||||||
|
|
@ -0,0 +1,24 @@ |
|||||||
|
package com.fr.solution.plugin.chart.echarts.legend; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Legend; |
||||||
|
import com.fr.solution.plugin.chart.echarts.glyph.NewLegendGlyph; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 16/2/18. |
||||||
|
*/ |
||||||
|
public class NewLegend extends Legend { |
||||||
|
|
||||||
|
public static final String XML_TAG = "NewLegend"; |
||||||
|
|
||||||
|
public NewLegendGlyph createLegendGlyph() { |
||||||
|
NewLegendGlyph resultLegendGlyph = new NewLegendGlyph(); |
||||||
|
|
||||||
|
resultLegendGlyph.setFont(getFRFont()); |
||||||
|
resultLegendGlyph.setGeneralInfo(this); |
||||||
|
resultLegendGlyph.setPosition(getPosition()); |
||||||
|
resultLegendGlyph.setVisible(isLegendVisible()); |
||||||
|
|
||||||
|
return resultLegendGlyph; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
package com.fr.solution.plugin.chart.echarts.plot; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Legend; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.chart.chartglyph.PlotGlyph; |
||||||
|
import com.fr.general.ComparatorUtils; |
||||||
|
import com.fr.solution.plugin.chart.echarts.glyph.NewLegendGlyph; |
||||||
|
import com.fr.solution.plugin.chart.echarts.legend.NewLegend; |
||||||
|
import com.fr.stable.xml.XMLableReader; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 16/2/2. |
||||||
|
*/ |
||||||
|
public abstract class NewPlot extends Plot { |
||||||
|
|
||||||
|
public NewPlot() { |
||||||
|
setLegend(new NewLegend()); |
||||||
|
} |
||||||
|
|
||||||
|
public boolean accept(Class<? extends Plot> obClass) { |
||||||
|
return ComparatorUtils.equals(NewPlot.class, obClass); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public NewLegendGlyph createLegendGlyph(PlotGlyph plotGlyph) { |
||||||
|
NewLegend legend = (NewLegend) getLegend(); |
||||||
|
return legend.createLegendGlyph(); |
||||||
|
} |
||||||
|
|
||||||
|
protected void readPlotXML(XMLableReader reader){ |
||||||
|
if (reader.isChildNode()) { |
||||||
|
String tagName = reader.getTagName(); |
||||||
|
|
||||||
|
if (NewLegend.XML_TAG.equals(tagName)) { |
||||||
|
setLegend((Legend)reader.readXMLObject(new NewLegend())); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.fr.solution.plugin.chart.echarts.title; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Title; |
||||||
|
import com.fr.solution.plugin.chart.echarts.glyph.NewTitleGlyph; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 16/2/18. |
||||||
|
*/ |
||||||
|
public class NewTitle extends Title { |
||||||
|
public static final String XML_TAG = "NewTitle"; |
||||||
|
|
||||||
|
@Override |
||||||
|
public NewTitleGlyph createGlyph() { |
||||||
|
return new NewTitleGlyph(); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue