@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts; |
||||
package com.fr.solution.plugin.chart.echarts.common; |
||||
|
||||
import com.fr.stable.fun.impl.AbstractLocaleFinder; |
||||
|
@ -0,0 +1,19 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.data; |
||||
|
||||
import com.fr.chart.chartdata.MoreNameCDDefinition; |
||||
import com.fr.chart.chartdata.NormalChartData; |
||||
|
||||
/** |
||||
* Created by Mitisky on 16/1/19. |
||||
*/ |
||||
public class EChartsMoreNameCDDefinition extends MoreNameCDDefinition { |
||||
|
||||
private static final long serialVersionUID = -2555257182076448042L; |
||||
|
||||
protected NormalChartData getNormalChartData(Object[] series_name_array, Object[][] series_v_2D) { |
||||
NormalChartData normal = new EChartsNormalChartData(categoryLabels, series_name_array, series_v_2D); |
||||
normal.setSecondCates(secondLabels); |
||||
normal.setThirdCates(thirdLabels); |
||||
return normal; |
||||
} |
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.data; |
||||
|
||||
import com.fr.chart.chartdata.NormalChartData; |
||||
|
||||
/** |
||||
* Created by Mitisky on 16/1/19. |
||||
* 不做大数据过滤 |
||||
*/ |
||||
public class EChartsNormalChartData extends NormalChartData { |
||||
|
||||
public EChartsNormalChartData() { |
||||
|
||||
} |
||||
|
||||
public EChartsNormalChartData(Object[] category_array, Object[] series_array, Object[][] series_value_2D) { |
||||
super(category_array, series_array, series_value_2D); |
||||
} |
||||
|
||||
/** |
||||
* 处理大数据.1000分类. |
||||
* 不做任何处理 |
||||
*/ |
||||
public void dealHugeData() { |
||||
//新的图表数据不在这里处理大数据
|
||||
//画图的时候处理:折线图相同像素点只画一个,其他图表有配置是否采用大数据模式。
|
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.data; |
||||
|
||||
import com.fr.chart.chartdata.NormalChartData; |
||||
import com.fr.chart.chartdata.NormalReportDataDefinition; |
||||
|
||||
/** |
||||
* Created by Mitisky on 16/1/19. |
||||
* |
||||
*/ |
||||
public class EChartsNormalReportDataDefinition extends NormalReportDataDefinition { |
||||
|
||||
private static final long serialVersionUID = -645098535257304519L; |
||||
|
||||
protected NormalChartData getNormalDataObject() { |
||||
return new EChartsNormalChartData(); |
||||
} |
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.data; |
||||
|
||||
import com.fr.chart.chartdata.NormalChartData; |
||||
import com.fr.chart.chartdata.OneValueCDDefinition; |
||||
|
||||
/** |
||||
* Created by Mitisky on 16/1/19. |
||||
*/ |
||||
public class EChartsOneValueCDDefinition extends OneValueCDDefinition { |
||||
|
||||
private static final long serialVersionUID = -7069079313068958054L; |
||||
|
||||
protected NormalChartData getNormalChartData(Object[] series_name_array, Object[][] series_v_2D) { |
||||
NormalChartData normal = new EChartsNormalChartData(categoryLabels, series_name_array, series_v_2D); |
||||
normal.setSecondCates(secondLabels); |
||||
normal.setThirdCates(thirdLabels); |
||||
return normal; |
||||
} |
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.glyph; |
||||
|
||||
import com.fr.chart.chartglyph.LegendGlyph; |
||||
import com.fr.chart.chartglyph.LegendItem; |
||||
import com.fr.json.JSONArray; |
||||
import com.fr.json.JSONException; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.stable.ArrayUtils; |
||||
import com.fr.stable.web.Repository; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/2. |
||||
*/ |
||||
public class EChartsLegendGlyph extends LegendGlyph { |
||||
|
||||
public EChartsLegendGlyph(LegendItem[] items) { |
||||
super(items); |
||||
} |
||||
|
||||
@Override |
||||
public JSONObject toJSONObject(Repository repo) throws JSONException { |
||||
JSONObject result = JSONObject.create() |
||||
.put("orient", "horizontal") |
||||
.put("y", "bottom"); |
||||
LegendItem[] items = getItems(); |
||||
|
||||
if (ArrayUtils.isNotEmpty(items)) { |
||||
JSONArray data = JSONArray.create(); |
||||
result.put("data", data); |
||||
for (LegendItem item : items) { |
||||
JSONObject jo = item.toJSONObject(repo); |
||||
data.put(jo.optString("label")); |
||||
} |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
} |
@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts.glyph; |
||||
package com.fr.solution.plugin.chart.echarts.common.glyph; |
||||
|
||||
import com.fr.chart.chartglyph.PlotGlyph; |
||||
import com.fr.json.JSONArray; |
@ -0,0 +1,52 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.title; |
||||
|
||||
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.EChartsTitleGlyph; |
||||
import com.fr.stable.xml.XMLPrintWriter; |
||||
import com.fr.stable.xml.XMLableReader; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsTitle extends Title { |
||||
|
||||
public static final String XML_TAG = "EChartsTitle"; |
||||
|
||||
@Override |
||||
public EChartsTitleGlyph createGlyph() { |
||||
Object text = getTextObject(); |
||||
String text4Glyph = null; |
||||
if(text instanceof Formula) { |
||||
Formula formula = (Formula)text; |
||||
if(formula.getResult() != null) { |
||||
text4Glyph = Utils.objectToString(formula.getResult()); |
||||
} |
||||
} else { |
||||
text4Glyph = GeneralUtils.objectToString(text); |
||||
} |
||||
return new EChartsTitleGlyph(text4Glyph); |
||||
} |
||||
|
||||
@Override |
||||
public void readXML(XMLableReader reader) { |
||||
super.readXML(reader); |
||||
|
||||
if (reader.isChildNode()) { |
||||
String name = reader.getTagName(); |
||||
if ("Attr4ECharts".equals(name)) { |
||||
|
||||
} |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void writeXML(XMLPrintWriter writer) { |
||||
writer.startTAG(XML_TAG); |
||||
super.writeXML(writer); |
||||
writer.startTAG("Attr4ECharts").end(); |
||||
writer.end(); |
||||
} |
||||
} |
@ -1,11 +1,11 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui; |
||||
package com.fr.solution.plugin.chart.echarts.common.ui; |
||||
|
||||
import com.fr.chart.chartattr.Chart; |
||||
import com.fr.chart.chartattr.Plot; |
||||
import com.fr.chart.chartglyph.ConditionCollection; |
||||
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
||||
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; |
||||
import com.fr.solution.plugin.chart.echarts.base.ECharts; |
||||
import com.fr.solution.plugin.chart.echarts.common.base.ECharts; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
@ -0,0 +1,25 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.ui; |
||||
|
||||
import com.fr.design.chart.fun.impl.AbstractIndependentChartUI; |
||||
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||
import com.fr.design.mainframe.chart.AbstractChartAttrPane; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public abstract class AbstractIndependentEChartsUI extends AbstractIndependentChartUI { |
||||
|
||||
private EChartsStylePane stylePane; |
||||
|
||||
@Override |
||||
public boolean isUseDefaultPane() { |
||||
return false; |
||||
} |
||||
|
||||
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ |
||||
if (stylePane == null) { |
||||
stylePane = new EChartsStylePane(listener); |
||||
} |
||||
return new AbstractChartAttrPane[]{stylePane}; |
||||
} |
||||
} |
@ -0,0 +1,218 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.ui; |
||||
|
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.dialog.MultiTabPane; |
||||
import com.fr.design.event.UIObserver; |
||||
import com.fr.design.event.UIObserverListener; |
||||
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||
import com.fr.design.mainframe.chart.AbstractChartAttrPane; |
||||
import com.fr.design.mainframe.chart.PaneTitleConstants; |
||||
import com.fr.solution.plugin.chart.echarts.common.base.ECharts; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
public class EChartsStylePane extends AbstractChartAttrPane implements UIObserver { |
||||
|
||||
|
||||
private KindOfTabPane kindOfTabPane; |
||||
|
||||
private EChartsTitlePane titlePane; |
||||
private BasicPane tooltipPane; |
||||
|
||||
private AttributeChangeListener listener; |
||||
private UIObserverListener uiObserverListener; |
||||
private ECharts chart; |
||||
|
||||
public EChartsStylePane(AttributeChangeListener listener) { |
||||
this.listener = listener; |
||||
initComponents(); |
||||
} |
||||
|
||||
private void initComponents() { |
||||
setLayout(new BorderLayout()); |
||||
titlePane = new EChartsTitlePane(this); |
||||
tooltipPane = new BasicPane() { |
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "Tooltip"; |
||||
} |
||||
}; |
||||
} |
||||
|
||||
protected void initSelfListener(Container parentComponent) { |
||||
for (int i = 0; i < parentComponent.getComponentCount(); i++) { |
||||
Component tmpComp = parentComponent.getComponent(i); |
||||
if (tmpComp instanceof Container) { |
||||
initListener((Container) tmpComp); |
||||
} |
||||
if (tmpComp instanceof UIObserver) { |
||||
((UIObserver) tmpComp).registerChangeListener(uiObserverListener); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected JPanel createContentPane() { |
||||
JPanel content = new JPanel(new BorderLayout()); |
||||
if (chart == null) { |
||||
return content; |
||||
} |
||||
kindOfTabPane = new KindOfTabPane(); |
||||
content.add(kindOfTabPane, BorderLayout.CENTER); |
||||
return content; |
||||
} |
||||
|
||||
/** |
||||
* 返回对应的图片路径. |
||||
*/ |
||||
public String getIconPath() { |
||||
return "com/fr/solution/plugin/chart/echarts/images/toolbar_item.png"; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void populate(ChartCollection collection) { |
||||
this.chart = (ECharts) collection.getSelectedChart(); |
||||
this.remove(leftContentPane); |
||||
initContentPane(); |
||||
this.removeAttributeChangeListener(); |
||||
kindOfTabPane.populateBean(chart); |
||||
this.addAttributeChangeListener(listener); |
||||
this.initAllListeners(); |
||||
} |
||||
|
||||
@Override |
||||
public void update(ChartCollection collection) { |
||||
kindOfTabPane.updateBean((ECharts) collection.getSelectedChart()); |
||||
} |
||||
|
||||
/** |
||||
* 返回界面的标题名称 |
||||
* |
||||
* @return 返回名称. |
||||
*/ |
||||
public String title4PopupWindow() { |
||||
return PaneTitleConstants.CHART_STYLE_TITLE; |
||||
} |
||||
|
||||
/** |
||||
* 注册事件监听器 |
||||
* |
||||
* @param listener 观察者监听事件 |
||||
*/ |
||||
public void registerChangeListener(UIObserverListener listener) { |
||||
this.uiObserverListener = listener; |
||||
} |
||||
|
||||
/** |
||||
* 是否相应事件 |
||||
* |
||||
* @return 是 |
||||
*/ |
||||
public boolean shouldResponseChangeListener() { |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* 二级tab组件 |
||||
*/ |
||||
public class KindOfTabPane extends MultiTabPane<ECharts> { |
||||
|
||||
@Override |
||||
protected void initLayout() { |
||||
JPanel tabPanel = new JPanel(new BorderLayout()); |
||||
tabPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 10, getBackground())); |
||||
tabPanel.add(tabPane, BorderLayout.CENTER); |
||||
|
||||
setLayout(new BorderLayout(0, 4)); |
||||
add(tabPanel, BorderLayout.NORTH); |
||||
add(centerPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
@Override |
||||
protected void dealWithTabChanged(int index) { |
||||
dealWithChosenPane(index); |
||||
cardLayout.show(centerPane, NameArray[index]); |
||||
tabChanged(); |
||||
} |
||||
|
||||
private void dealWithChosenPane(int index) { |
||||
//第一个总是标题
|
||||
if (index == 0) { |
||||
return; |
||||
} |
||||
|
||||
BasicPane chosenPane = paneList.get(index); |
||||
centerPane.remove(index); |
||||
paneList.remove(index); |
||||
|
||||
/** |
||||
* richie:这边的目的是把空的展位面板替换成显示真是数据的面板 |
||||
*/ |
||||
if (chosenPane == tooltipPane) { |
||||
chosenPane = new EChartsTooltipPane(EChartsStylePane.this); |
||||
} |
||||
|
||||
initSelfListener(chosenPane); |
||||
centerPane.add(chosenPane, chosenPane.getTitle(), index); |
||||
paneList.add(index, chosenPane); |
||||
} |
||||
|
||||
@Override |
||||
protected void tabChanged() { |
||||
EChartsStylePane.this.removeAttributeChangeListener(); |
||||
((BasicBeanPane<ECharts>) paneList.get(tabPane.getSelectedIndex())).populateBean(chart); |
||||
EChartsStylePane.this.addAttributeChangeListener(listener); |
||||
} |
||||
|
||||
@Override |
||||
protected List<BasicPane> initPaneList() { |
||||
java.util.List<BasicPane> paneList = new ArrayList<BasicPane>(); |
||||
paneList.add(titlePane); |
||||
paneList.add(tooltipPane); |
||||
return paneList; |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(ECharts ob) { |
||||
if (chart == null || kindOfTabPane.getSelectedIndex() == -1) { |
||||
return; |
||||
} |
||||
((BasicBeanPane<ECharts>) paneList.get(kindOfTabPane.getSelectedIndex())).populateBean(chart); |
||||
} |
||||
|
||||
@Override |
||||
public ECharts updateBean() { |
||||
if (chart == null) { |
||||
return null; |
||||
} |
||||
((BasicBeanPane<ECharts>) paneList.get(kindOfTabPane.getSelectedIndex())).updateBean(chart); |
||||
return chart; |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(ECharts ob) { |
||||
((BasicBeanPane<ECharts>) paneList.get(kindOfTabPane.getSelectedIndex())).updateBean(ob); |
||||
} |
||||
|
||||
@Override |
||||
public boolean accept(Object ob) { |
||||
return true; |
||||
} |
||||
|
||||
@Override |
||||
public String title4PopupWindow() { |
||||
return "Tab"; |
||||
} |
||||
|
||||
@Override |
||||
public void reset() { |
||||
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,90 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.ui; |
||||
|
||||
import com.fr.base.Formula; |
||||
import com.fr.base.Utils; |
||||
import com.fr.design.dialog.BasicScrollPane; |
||||
import com.fr.design.formula.TinyFormulaPane; |
||||
import com.fr.design.gui.ibutton.UIButtonGroup; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.general.GeneralUtils; |
||||
import com.fr.solution.plugin.chart.echarts.common.base.ECharts; |
||||
import com.fr.solution.plugin.chart.echarts.common.title.EChartsTitle; |
||||
import com.fr.stable.StableUtils; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/19. |
||||
*/ |
||||
public class EChartsTitlePane extends BasicScrollPane<ECharts> { |
||||
|
||||
private UIButtonGroup<Boolean> showTitle; |
||||
|
||||
private TinyFormulaPane tinyFormulaPane; |
||||
|
||||
private EChartsStylePane parent; |
||||
|
||||
public EChartsTitlePane(EChartsStylePane parent) { |
||||
this.parent = parent; |
||||
} |
||||
|
||||
@Override |
||||
protected JPanel createContentPane() { |
||||
JPanel panel = new JPanel(new BorderLayout()); |
||||
double p = TableLayout.PREFERRED; |
||||
double f = TableLayout.FILL; |
||||
double[] rowSize = {p, p}; |
||||
double[] columnSize = {p, f}; |
||||
showTitle = new UIButtonGroup<Boolean>(new String[]{"显示", "不显示"}, new Boolean[]{true, false}); |
||||
showTitle.setSelectedIndex(0); |
||||
tinyFormulaPane = new TinyFormulaPane(); |
||||
JPanel cen = TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
||||
{new UILabel("显示标题"), showTitle}, |
||||
{new UILabel("标题内容"), tinyFormulaPane} |
||||
}, rowSize, columnSize); |
||||
panel.add(cen, BorderLayout.CENTER); |
||||
return panel; |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(ECharts ob) { |
||||
EChartsTitle title = (EChartsTitle) ob.getTitle(); |
||||
if (title == null) { |
||||
return; |
||||
} |
||||
showTitle.setSelectedItem(title.isTitleVisble()); |
||||
if (title.getTextObject() instanceof Formula) { |
||||
tinyFormulaPane.populateBean(((Formula) title.getTextObject()).getContent()); |
||||
} else { |
||||
tinyFormulaPane.populateBean(GeneralUtils.objectToString(title.getTextObject())); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(ECharts ob) { |
||||
if (ob == null) { |
||||
ob = new ECharts(); |
||||
} |
||||
EChartsTitle title = (EChartsTitle) ob.getTitle(); |
||||
if (title == null) { |
||||
title = new EChartsTitle(); |
||||
} |
||||
title.setTitleVisble(showTitle.getSelectedItem()); |
||||
String titleString = tinyFormulaPane.updateBean(); |
||||
Object titleObj; |
||||
if (StableUtils.maybeFormula(titleString)) { |
||||
titleObj = new Formula(titleString); |
||||
} else { |
||||
titleObj = titleString; |
||||
} |
||||
title.setTextObject(titleObj); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "Title"; |
||||
} |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fr.solution.plugin.chart.echarts.common.ui; |
||||
|
||||
import com.fr.design.dialog.BasicScrollPane; |
||||
import com.fr.solution.plugin.chart.echarts.common.base.ECharts; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/19. |
||||
*/ |
||||
public class EChartsTooltipPane extends BasicScrollPane<ECharts> { |
||||
|
||||
public EChartsTooltipPane(EChartsStylePane parent) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
protected JPanel createContentPane() { |
||||
return new JPanel(); |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(ECharts ob) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "Tooltip"; |
||||
} |
||||
} |
@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui.data; |
||||
package com.fr.solution.plugin.chart.echarts.common.ui.data; |
||||
|
||||
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane; |
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui.filter; |
||||
package com.fr.solution.plugin.chart.echarts.common.ui.filter; |
||||
|
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.chart.chartattr.Plot; |
@ -0,0 +1,374 @@
|
||||
/** |
||||
* Created by richie on 16/1/29. |
||||
*/ |
||||
EChartsFactory = function(options, $dom) { |
||||
this.options = options; |
||||
this.$dom = $dom; |
||||
this.chartID = options.chartID; |
||||
this.autoRefreshTime = options.autoRefreshTime || 0; |
||||
|
||||
this.width = options.width || $dom.width();// 补充从dom获取.
|
||||
this.height = options.height || $dom.height(); |
||||
this.sheetIndex = options.sheetIndex || 0; |
||||
this.ecName = options.ecName || ''; |
||||
|
||||
FR.Chart.WebUtils._installChart(this, this.chartID); |
||||
}; |
||||
|
||||
EChartsFactory.prototype = { |
||||
|
||||
constructor : EChartsFactory, |
||||
|
||||
inits : function() { |
||||
var theme = { |
||||
// 全图默认背景
|
||||
backgroundColor: '#1b1b1b', |
||||
|
||||
// 默认色板
|
||||
color: [ |
||||
'#FE8463','#9BCA63','#FAD860','#60C0DD','#0084C6', |
||||
'#D7504B','#C6E579','#26C0C0','#F0805A','#F4E001', |
||||
'#B5C334' |
||||
], |
||||
|
||||
// 图表标题
|
||||
title: { |
||||
textStyle: { |
||||
fontWeight: 'normal', |
||||
color: '#fff' // 主标题文字颜色
|
||||
} |
||||
}, |
||||
|
||||
// 图例
|
||||
legend: { |
||||
textStyle: { |
||||
color: '#ccc' // 图例文字颜色
|
||||
} |
||||
}, |
||||
|
||||
// 值域
|
||||
dataRange: { |
||||
itemWidth: 15, |
||||
color: ['#FFF808','#21BCF9'], |
||||
textStyle: { |
||||
color: '#ccc' // 值域文字颜色
|
||||
} |
||||
}, |
||||
|
||||
toolbox: { |
||||
color : ['#fff', '#fff', '#fff', '#fff'], |
||||
effectiveColor : '#FE8463', |
||||
disableColor: '#666' |
||||
}, |
||||
|
||||
// 提示框
|
||||
tooltip: { |
||||
backgroundColor: 'rgba(250,250,250,0.8)', // 提示背景颜色,默认为透明度为0.7的黑色
|
||||
axisPointer : { // 坐标轴指示器,坐标轴触发有效
|
||||
type : 'line', // 默认为直线,可选为:'line' | 'shadow'
|
||||
lineStyle : { // 直线指示器样式设置
|
||||
color: '#aaa' |
||||
}, |
||||
crossStyle: { |
||||
color: '#aaa' |
||||
}, |
||||
shadowStyle : { // 阴影指示器样式设置
|
||||
color: 'rgba(200,200,200,0.2)' |
||||
} |
||||
}, |
||||
textStyle: { |
||||
color: '#333' |
||||
} |
||||
}, |
||||
|
||||
// 区域缩放控制器
|
||||
dataZoom: { |
||||
dataBackgroundColor: '#555', // 数据背景颜色
|
||||
fillerColor: 'rgba(200,200,200,0.2)', // 填充颜色
|
||||
handleColor: '#eee' // 手柄颜色
|
||||
}, |
||||
|
||||
// 网格
|
||||
grid: { |
||||
borderWidth: 0 |
||||
}, |
||||
|
||||
// 类目轴
|
||||
categoryAxis: { |
||||
axisLine: { // 坐标轴线
|
||||
show: false |
||||
}, |
||||
axisTick: { // 坐标轴小标记
|
||||
show: false |
||||
}, |
||||
axisLabel: { // 坐标轴文本标签,详见axis.axisLabel
|
||||
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
||||
color: '#ccc' |
||||
} |
||||
}, |
||||
splitLine: { // 分隔线
|
||||
show: false |
||||
} |
||||
}, |
||||
|
||||
// 数值型坐标轴默认参数
|
||||
valueAxis: { |
||||
axisLine: { // 坐标轴线
|
||||
show: false |
||||
}, |
||||
axisTick: { // 坐标轴小标记
|
||||
show: false |
||||
}, |
||||
axisLabel: { // 坐标轴文本标签,详见axis.axisLabel
|
||||
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
||||
color: '#ccc' |
||||
} |
||||
}, |
||||
splitLine: { // 分隔线
|
||||
lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
|
||||
color: ['#aaa'], |
||||
type: 'dashed' |
||||
} |
||||
}, |
||||
splitArea: { // 分隔区域
|
||||
show: false |
||||
} |
||||
}, |
||||
|
||||
polar : { |
||||
name : { |
||||
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
||||
color: '#ccc' |
||||
} |
||||
}, |
||||
axisLine: { // 坐标轴线
|
||||
lineStyle: { // 属性lineStyle控制线条样式
|
||||
color: '#ddd' |
||||
} |
||||
}, |
||||
splitArea : { |
||||
show : true, |
||||
areaStyle : { |
||||
color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)'] |
||||
} |
||||
}, |
||||
splitLine : { |
||||
lineStyle : { |
||||
color : '#ddd' |
||||
} |
||||
} |
||||
}, |
||||
|
||||
timeline : { |
||||
label: { |
||||
textStyle:{ |
||||
color: '#ccc' |
||||
} |
||||
}, |
||||
lineStyle : { |
||||
color : '#aaa' |
||||
}, |
||||
controlStyle : { |
||||
normal : { color : '#fff'}, |
||||
emphasis : { color : '#FE8463'} |
||||
}, |
||||
symbolSize : 3 |
||||
}, |
||||
|
||||
// 折线图默认参数
|
||||
line: { |
||||
smooth : true |
||||
}, |
||||
|
||||
// K线图默认参数
|
||||
k: { |
||||
itemStyle: { |
||||
normal: { |
||||
color: '#FE8463', // 阳线填充颜色
|
||||
color0: '#9BCA63', // 阴线填充颜色
|
||||
lineStyle: { |
||||
width: 1, |
||||
color: '#FE8463', // 阳线边框颜色
|
||||
color0: '#9BCA63' // 阴线边框颜色
|
||||
} |
||||
} |
||||
} |
||||
}, |
||||
|
||||
// 雷达图默认参数
|
||||
radar : { |
||||
symbol: 'emptyCircle', // 图形类型
|
||||
symbolSize:3 |
||||
//symbol: null, // 拐点图形类型
|
||||
//symbolRotate : null, // 图形旋转控制
|
||||
}, |
||||
|
||||
pie: { |
||||
itemStyle: { |
||||
normal: { |
||||
borderWidth: 1, |
||||
borderColor : 'rgba(255, 255, 255, 0.5)' |
||||
}, |
||||
emphasis: { |
||||
borderWidth: 1, |
||||
borderColor : 'rgba(255, 255, 255, 1)' |
||||
} |
||||
} |
||||
}, |
||||
|
||||
map: { |
||||
itemStyle: { |
||||
normal: { |
||||
borderColor:'rgba(255, 255, 255, 0.5)', |
||||
areaStyle: { |
||||
color: '#ddd' |
||||
}, |
||||
label: { |
||||
textStyle: { |
||||
// color: '#ccc'
|
||||
} |
||||
} |
||||
}, |
||||
emphasis: { // 也是选中样式
|
||||
areaStyle: { |
||||
color: '#FE8463' |
||||
}, |
||||
label: { |
||||
textStyle: { |
||||
// color: 'ccc'
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
|
||||
force : { |
||||
itemStyle: { |
||||
normal: { |
||||
linkStyle : { |
||||
color : '#fff' |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
|
||||
chord : { |
||||
itemStyle : { |
||||
normal : { |
||||
borderWidth: 1, |
||||
borderColor: 'rgba(228, 228, 228, 0.2)', |
||||
chordStyle : { |
||||
lineStyle : { |
||||
color : 'rgba(228, 228, 228, 0.2)' |
||||
} |
||||
} |
||||
}, |
||||
emphasis : { |
||||
borderWidth: 1, |
||||
borderColor: 'rgba(228, 228, 228, 0.9)', |
||||
chordStyle : { |
||||
lineStyle : { |
||||
color : 'rgba(228, 228, 228, 0.9)' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
|
||||
gauge : { |
||||
axisLine: { // 坐标轴线
|
||||
show: true, // 默认显示,属性show控制显示与否
|
||||
lineStyle: { // 属性lineStyle控制线条样式
|
||||
color: [[0.2, '#9BCA63'],[0.8, '#60C0DD'],[1, '#D7504B']], |
||||
width: 3, |
||||
shadowColor : '#fff', //默认透明
|
||||
shadowBlur: 10 |
||||
} |
||||
}, |
||||
axisTick: { // 坐标轴小标记
|
||||
length :15, // 属性length控制线长
|
||||
lineStyle: { // 属性lineStyle控制线条样式
|
||||
color: 'auto', |
||||
shadowColor : '#fff', //默认透明
|
||||
shadowBlur: 10 |
||||
} |
||||
}, |
||||
axisLabel: { // 坐标轴小标记
|
||||
textStyle: { // 属性lineStyle控制线条样式
|
||||
fontWeight: 'bolder', |
||||
color: '#fff', |
||||
shadowColor : '#fff', //默认透明
|
||||
shadowBlur: 10 |
||||
} |
||||
}, |
||||
splitLine: { // 分隔线
|
||||
length :25, // 属性length控制线长
|
||||
lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
|
||||
width:3, |
||||
color: '#fff', |
||||
shadowColor : '#fff', //默认透明
|
||||
shadowBlur: 10 |
||||
} |
||||
}, |
||||
pointer: { // 分隔线
|
||||
shadowColor : '#fff', //默认透明
|
||||
shadowBlur: 5 |
||||
}, |
||||
title : { |
||||
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
||||
fontWeight: 'bolder', |
||||
fontSize: 20, |
||||
fontStyle: 'italic', |
||||
color: '#fff', |
||||
shadowColor : '#fff', //默认透明
|
||||
shadowBlur: 10 |
||||
} |
||||
}, |
||||
detail : { |
||||
shadowColor : '#fff', //默认透明
|
||||
shadowBlur: 5, |
||||
offsetCenter: [0, '50%'], // x, y,单位px
|
||||
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
||||
fontWeight: 'bolder', |
||||
color: '#fff' |
||||
} |
||||
} |
||||
}, |
||||
|
||||
funnel : { |
||||
itemStyle: { |
||||
normal: { |
||||
borderColor : 'rgba(255, 255, 255, 0.5)', |
||||
borderWidth: 1 |
||||
}, |
||||
emphasis: { |
||||
borderColor : 'rgba(255, 255, 255, 1)', |
||||
borderWidth: 1 |
||||
} |
||||
} |
||||
}, |
||||
|
||||
textStyle: { |
||||
fontFamily: '微软雅黑, Arial, Verdana, sans-serif' |
||||
} |
||||
}; |
||||
this.newCharts = echarts.init(this.$dom[0], theme); |
||||
this.newCharts.setOption(this.options.chartAttr); |
||||
}, |
||||
|
||||
resize : function() { |
||||
this.newCharts.resize(); |
||||
}, |
||||
refresh:function() { |
||||
|
||||
}, |
||||
|
||||
refreshData:function(options){ |
||||
|
||||
}, |
||||
|
||||
//数据监控的刷新方式
|
||||
setData:function(options, aimation){ |
||||
|
||||
} |
||||
}; |
@ -1,25 +0,0 @@
|
||||
package com.fr.solution.plugin.chart.echarts.glyph; |
||||
|
||||
import com.fr.chart.chartglyph.LegendGlyph; |
||||
import com.fr.json.JSONArray; |
||||
import com.fr.json.JSONException; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.stable.web.Repository; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/2. |
||||
*/ |
||||
public class EChartsLegendGlyph extends LegendGlyph { |
||||
|
||||
@Override |
||||
public JSONObject toJSONObject(Repository repo) throws JSONException { |
||||
return createLegend(repo); |
||||
} |
||||
|
||||
private JSONObject createLegend(Repository repo) throws JSONException { |
||||
return JSONObject.create() |
||||
.put("orient", "vertical") |
||||
.put("x", "left") |
||||
.put("data", JSONArray.create().put("iPhone3").put("iPhone4").put("iPhone5")); |
||||
} |
||||
} |
@ -1,26 +0,0 @@
|
||||
package com.fr.solution.plugin.chart.echarts.glyph.pie; |
||||
|
||||
import com.fr.json.JSONArray; |
||||
import com.fr.json.JSONException; |
||||
import com.fr.solution.plugin.chart.echarts.glyph.EChartsPlotGlyph; |
||||
import com.fr.stable.web.Repository; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsPiePlotGlyph extends EChartsPlotGlyph { |
||||
@Override |
||||
public String getPlotGlyphType() { |
||||
return "EChartsPiePlotGlyph"; |
||||
} |
||||
|
||||
@Override |
||||
public String getChartType() { |
||||
return "EChartsPie"; |
||||
} |
||||
|
||||
public JSONArray toSeriesData(Repository repo) throws JSONException { |
||||
JSONArray series = JSONArray.create(); |
||||
return series; |
||||
} |
||||
} |
After Width: | Height: | Size: 314 B |
@ -1,9 +1,9 @@
|
||||
package com.fr.solution.plugin.chart.echarts.glyph.map; |
||||
package com.fr.solution.plugin.chart.echarts.map.glyph; |
||||
|
||||
import com.fr.json.JSONArray; |
||||
import com.fr.json.JSONException; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.solution.plugin.chart.echarts.glyph.EChartsPlotGlyph; |
||||
import com.fr.solution.plugin.chart.echarts.common.glyph.EChartsPlotGlyph; |
||||
import com.fr.stable.web.Repository; |
||||
|
||||
/** |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts.monitor; |
||||
package com.fr.solution.plugin.chart.echarts.map.monitor; |
||||
|
||||
import com.fr.general.Inter; |
||||
import com.fr.stable.fun.FunctionHelper; |
@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui.map; |
||||
package com.fr.solution.plugin.chart.echarts.map.ui; |
||||
|
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.design.event.UIObserver; |
@ -1,7 +1,7 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui.map; |
||||
package com.fr.solution.plugin.chart.echarts.map.ui; |
||||
|
||||
import com.fr.design.mainframe.chart.gui.ChartDataPane; |
||||
import com.fr.solution.plugin.chart.echarts.ui.data.AbstractEChartsTableDataContentPane; |
||||
import com.fr.solution.plugin.chart.echarts.common.ui.data.AbstractEChartsTableDataContentPane; |
||||
|
||||
/** |
||||
* Created by richie on 16/1/29. |
@ -0,0 +1,51 @@
|
||||
package com.fr.solution.plugin.chart.echarts.pie.glyph; |
||||
|
||||
import com.fr.chart.chartglyph.DataPoint; |
||||
import com.fr.chart.chartglyph.DataSeries; |
||||
import com.fr.json.JSONArray; |
||||
import com.fr.json.JSONException; |
||||
import com.fr.json.JSONFunction; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.solution.plugin.chart.echarts.common.glyph.EChartsPlotGlyph; |
||||
import com.fr.stable.web.Repository; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsPiePlotGlyph extends EChartsPlotGlyph { |
||||
@Override |
||||
public String getPlotGlyphType() { |
||||
return "EChartsPiePlotGlyph"; |
||||
} |
||||
|
||||
@Override |
||||
public String getChartType() { |
||||
return "EChartsPie"; |
||||
} |
||||
|
||||
public JSONArray toSeriesData(Repository repo) throws JSONException { |
||||
JSONArray result = JSONArray.create(); |
||||
JSONObject wrapper = JSONObject.create(); |
||||
result.put(wrapper); |
||||
wrapper.put("type", "pie"); |
||||
wrapper.put("itemStyle", |
||||
JSONObject.create().put("normal", |
||||
JSONObject.create().put("label", |
||||
JSONObject.create().put("formatter", "{c}")))); |
||||
JSONArray data = JSONArray.create(); |
||||
wrapper.put("data", data); |
||||
for (int i = 0, len = getSeriesSize(); i < len; i ++) { |
||||
DataSeries series = getSeries(i); |
||||
String name = series.getSeriesName(); |
||||
JSONObject item = JSONObject.create(); |
||||
data.put(item); |
||||
|
||||
item.put("name", name); |
||||
if (series.getDataPointCount() > 0) { |
||||
DataPoint dataPoint = series.getDataPoint(0); |
||||
item.put("value", dataPoint.getValue()); |
||||
} |
||||
} |
||||
return result; |
||||
} |
||||
} |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts.monitor; |
||||
package com.fr.solution.plugin.chart.echarts.pie.monitor; |
||||
|
||||
import com.fr.general.Inter; |
||||
import com.fr.stable.fun.FunctionHelper; |
@ -1,4 +1,4 @@
|
||||
package com.fr.solution.plugin.chart.echarts.plot.pie; |
||||
package com.fr.solution.plugin.chart.echarts.pie.plot; |
||||
|
||||
import com.fr.general.ComparatorUtils; |
||||
|
@ -0,0 +1,9 @@
|
||||
package com.fr.solution.plugin.chart.echarts.pie.ui; |
||||
|
||||
import com.fr.solution.plugin.chart.echarts.common.ui.data.AbstractEChartsReportDataContentPane; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsPieReportDataContentPane extends AbstractEChartsReportDataContentPane { |
||||
} |
@ -0,0 +1,14 @@
|
||||
package com.fr.solution.plugin.chart.echarts.pie.ui; |
||||
|
||||
import com.fr.design.mainframe.chart.gui.ChartDataPane; |
||||
import com.fr.design.mainframe.chart.gui.data.table.PiePlotTableDataContentPane; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsPieTableDataContentPane extends PiePlotTableDataContentPane { |
||||
|
||||
public EChartsPieTableDataContentPane(ChartDataPane parent) { |
||||
super(parent); |
||||
} |
||||
} |
@ -1,16 +0,0 @@
|
||||
package com.fr.solution.plugin.chart.echarts.title; |
||||
|
||||
import com.fr.chart.chartattr.Title; |
||||
import com.fr.solution.plugin.chart.echarts.glyph.EChartsTitleGlyph; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsTitle extends Title { |
||||
public static final String XML_TAG = "EChartsTitle"; |
||||
|
||||
@Override |
||||
public EChartsTitleGlyph createGlyph() { |
||||
return new EChartsTitleGlyph(); |
||||
} |
||||
} |
@ -1,14 +0,0 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui; |
||||
|
||||
import com.fr.design.chart.fun.impl.AbstractIndependentChartUI; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public abstract class AbstractIndependentEChartsUI extends AbstractIndependentChartUI { |
||||
|
||||
@Override |
||||
public boolean isUseDefaultPane() { |
||||
return false; |
||||
} |
||||
} |
@ -1,9 +0,0 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui.pie; |
||||
|
||||
import com.fr.solution.plugin.chart.echarts.ui.data.AbstractEChartsReportDataContentPane; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsPieReportDataContentPane extends AbstractEChartsReportDataContentPane { |
||||
} |
@ -1,14 +0,0 @@
|
||||
package com.fr.solution.plugin.chart.echarts.ui.pie; |
||||
|
||||
import com.fr.design.mainframe.chart.gui.ChartDataPane; |
||||
import com.fr.solution.plugin.chart.echarts.ui.data.AbstractEChartsTableDataContentPane; |
||||
|
||||
/** |
||||
* Created by richie on 16/2/18. |
||||
*/ |
||||
public class EChartsPieTableDataContentPane extends AbstractEChartsTableDataContentPane { |
||||
|
||||
public EChartsPieTableDataContentPane(ChartDataPane parent) { |
||||
super(parent); |
||||
} |
||||
} |
@ -1,42 +0,0 @@
|
||||
/** |
||||
* Created by richie on 16/1/29. |
||||
*/ |
||||
EChartsFactory = function(options, $dom) { |
||||
this.options = options; |
||||
this.$dom = $dom; |
||||
this.chartID = options.chartID; |
||||
this.autoRefreshTime = options.autoRefreshTime || 0; |
||||
|
||||
this.width = options.width || $dom.width();// 补充从dom获取.
|
||||
this.height = options.height || $dom.height(); |
||||
this.sheetIndex = options.sheetIndex || 0; |
||||
this.ecName = options.ecName || ''; |
||||
|
||||
FR.Chart.WebUtils._installChart(this, this.chartID); |
||||
}; |
||||
|
||||
EChartsFactory.prototype = { |
||||
|
||||
constructor : EChartsFactory, |
||||
|
||||
inits : function() { |
||||
this.newCharts = echarts.init(this.$dom[0]); |
||||
this.newCharts.setOption(this.options.chartAttr); |
||||
}, |
||||
|
||||
resize : function() { |
||||
this.newCharts.resize(); |
||||
}, |
||||
refresh:function() { |
||||
|
||||
}, |
||||
|
||||
refreshData:function(options){ |
||||
|
||||
}, |
||||
|
||||
//数据监控的刷新方式
|
||||
setData:function(options, aimation){ |
||||
|
||||
} |
||||
}; |