Browse Source

箱线图示例

pull/1/head
imp 5 years ago
parent
commit
d84bc8a931
  1. 27
      plugin-demo/README.md
  2. 15
      plugin-demo/plugin.xml
  3. 2
      plugin-demo/pom.xml
  4. BIN
      plugin-demo/screenshots/boxplot.png
  5. BIN
      plugin-demo/screenshots/link.png
  6. 23
      plugin-demo/src/main/java/com/finebi/plugin/BIBoxPlotChartComponent.java
  7. 23
      plugin-demo/src/main/java/com/finebi/plugin/BIDesignBoxPlotChart.java
  8. 25
      plugin-demo/src/main/java/com/finebi/plugin/BIPluginDemoComponent.java
  9. 6
      plugin-demo/src/main/java/com/finebi/plugin/BIShowBoxPlotChart.java
  10. 3
      plugin-demo/src/main/resources/com/finebi/plugin/web/BIPluginDemo.css
  11. 6
      plugin-demo/src/main/resources/com/finebi/plugin/web/BIPluginDemo.js
  12. 17
      plugin-demo/src/main/resources/com/finebi/plugin/web/css/chart.css
  13. BIN
      plugin-demo/src/main/resources/com/finebi/plugin/web/image/boxplot.png
  14. BIN
      plugin-demo/src/main/resources/com/finebi/plugin/web/image/disable.png
  15. 43997
      plugin-demo/src/main/resources/com/finebi/plugin/web/js/chart.js
  16. 7
      readme.md

27
plugin-demo/README.md

@ -1,21 +1,12 @@
# bi-plugin-starter
# 箱线图插件示例
FineBI插件模板
+ 编辑界面添加箱线图
+ 目录结构(需要添加工程依赖,依赖指向BI中WEB-INF中的lib)
- lib中放引用的第三方jar包
- src 代码&资源
- build.xml Ant编译脚本
- plugin.xml 插件
+ build.xml参数
- line4: JDK路径
- line8: 依赖的lib,从crm下bi的jar就行了
- line17: value="插件名"
![箱线图](./screenshots/boxplot.png)
+ 预览和编辑展示箱线图
+ 箱线图与其他图形的联动效果
![联动效果](./screenshots/link.png)
+ plugin.xml参数
- id:插件id
- name: 插件名
- ventor: 插件作者
- description:插件描述
- AbstractWebResourceProvider&function-recorder的class:插件类

15
plugin-demo/plugin.xml

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plugin>
<id>com.finebi.plugin.demo</id>
<id>com.finebi.plugin.boxplotchart</id>
<main-package>com.finebi</main-package>
<name><![CDATA[图片组件插件]]></name>
<name><![CDATA[BI箱线图]]></name>
<active>yes</active>
<version>1.0</version>
<env-version>8.0</env-version>
<env-version>10.0</env-version>
<jartime>2019-02-29</jartime>
<vendor>imp</vendor>
<description><![CDATA[图片组件在当前页面打开链接]]></description>
<description><![CDATA[BI箱线图图表插件]]></description>
<extra-decision>
<WebResourceProvider class="com.finebi.plugin.BIPluginDemo"/>
<WebResourceProvider class="com.finebi.plugin.BIShowBoxPlotChart"/>
<WebResourceProvider class="com.finebi.plugin.BIDesignBoxPlotChart"/>
</extra-decision>
<function-recorder class="com.finebi.plugin.BIPluginDemo"/>
<function-recorder class="com.finebi.plugin.BIShowBoxPlotChart"/>
<function-recorder class="com.finebi.plugin.BIDesignBoxPlotChart"/>
</plugin>

2
plugin-demo/pom.xml

@ -7,7 +7,7 @@
<parent>
<groupId>com.fr.plugin</groupId>
<artifactId>starter</artifactId>
<version>10.0</version>
<version>5.1</version>
</parent>
<packaging>jar</packaging>
<artifactId>plugin-demo</artifactId>

BIN
plugin-demo/screenshots/boxplot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

BIN
plugin-demo/screenshots/link.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

23
plugin-demo/src/main/java/com/finebi/plugin/BIBoxPlotChartComponent.java

@ -0,0 +1,23 @@
package com.finebi.plugin;
import com.fr.web.struct.Component;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.category.StylePath;
public class BIBoxPlotChartComponent extends Component {
public static final BIBoxPlotChartComponent KEY = new BIBoxPlotChartComponent();
private BIBoxPlotChartComponent() {
}
@Override
public ScriptPath script() {
return ScriptPath.build("com/finebi/plugin/web/js/chart.js");
}
public StylePath style() {
return StylePath.build("com/finebi/plugin/web/css/chart.css");
}
}

23
plugin-demo/src/main/java/com/finebi/plugin/BIDesignBoxPlotChart.java

@ -0,0 +1,23 @@
package com.finebi.plugin;
import com.finebi.conf.internalimp.component.ReportComponent;
import com.fr.decision.fun.impl.AbstractWebResourceProvider;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.web.struct.Atom;
@EnableMetrics
public class BIDesignBoxPlotChart extends AbstractWebResourceProvider {
@Override
public Atom attach() {
return ReportComponent.KEY;
}
@Override
@Focus(id = "com.finebi.plugin.BIDesignBoxPlotChart", text = "箱线图", source = Original.PLUGIN)
public Atom client() {
return BIBoxPlotChartComponent.KEY;
}
}

25
plugin-demo/src/main/java/com/finebi/plugin/BIPluginDemoComponent.java

@ -1,25 +0,0 @@
package com.finebi.plugin;
import com.fr.web.struct.Component;
import com.fr.web.struct.browser.RequestClient;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.category.StylePath;
public class BIPluginDemoComponent extends Component {
public static final BIPluginDemoComponent KEY = new BIPluginDemoComponent();
private BIPluginDemoComponent() {
}
@Override
public ScriptPath script(RequestClient client) {
return ScriptPath.build("com/finebi/plugin/web/BIPluginDemo.js");
}
@Override
public StylePath style(RequestClient client) {
return StylePath.build("com/finebi/plugin/web/BIPluginDemo.css");
}
}

6
plugin-demo/src/main/java/com/finebi/plugin/BIPluginDemo.java → plugin-demo/src/main/java/com/finebi/plugin/BIShowBoxPlotChart.java

@ -8,7 +8,7 @@ import com.fr.record.analyzer.EnableMetrics;
import com.fr.web.struct.Atom;
@EnableMetrics
public class BIPluginDemo extends AbstractWebResourceProvider {
public class BIShowBoxPlotChart extends AbstractWebResourceProvider {
@Override
public Atom attach() {
@ -16,8 +16,8 @@ public class BIPluginDemo extends AbstractWebResourceProvider {
}
@Override
@Focus(id = "com.finebi.plugin.demo", text = "BI插件测试", source = Original.PLUGIN)
@Focus(id = "com.finebi.plugin.BIShowBoxPlotChart", text = "箱线图", source = Original.PLUGIN)
public Atom client() {
return BIPluginDemoComponent.KEY;
return BIBoxPlotChartComponent.KEY;
}
}

3
plugin-demo/src/main/resources/com/finebi/plugin/web/BIPluginDemo.css

@ -1,3 +0,0 @@
.bi-dashboard-widget:hover .operator-region, .bi-control-widget:hover .operator-region {
display: none;
}

6
plugin-demo/src/main/resources/com/finebi/plugin/web/BIPluginDemo.js

@ -1,6 +0,0 @@
BI.Plugin.registerObject("bi.show.widget.image", function (widget) {
widget.img.un(BI.ImageButton.EVENT_CHANGE);
widget.img.element.on("click", function () {
location.href = BI.Format.formatAddress("www.baidu.com");
});
});

17
plugin-demo/src/main/resources/com/finebi/plugin/web/css/chart.css

@ -0,0 +1,17 @@
.chart-type-boxplot-column-icon .x-icon {
display: block;
background: url('/webroot/decision/resources?path=/com/finebi/plugin/web/image/boxplot.png') no-repeat center center;
background-size: contain;
}
.chart-type-boxplot-column-icon .x-icon.hack {
background: url('/webroot/decision/resources?path=/com/finebi/plugin/web/image/boxplot.png') no-repeat center center;
}
.chart-type-boxplot-column-disabled-icon .x-icon {
display: block;
background: url('/webroot/decision/resources?path=/com/finebi/plugin/web/image/disable.png') no-repeat center center;
background-size: contain;
}
.chart-type-boxplot-column-disabled-icon .x-icon.hack {
background: url('/webroot/decision/resources?path=/com/finebi/plugin/web/image/disable.png') no-repeat center center;
}

BIN
plugin-demo/src/main/resources/com/finebi/plugin/web/image/boxplot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
plugin-demo/src/main/resources/com/finebi/plugin/web/image/disable.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

43997
plugin-demo/src/main/resources/com/finebi/plugin/web/js/chart.js

File diff suppressed because it is too large Load Diff

7
readme.md

@ -1,13 +1,12 @@
# FineBI插件开发工程
# FineBI 插件开发工程
## 服务器启动
运行 ```com.finebi.start.Learner```即可启动BI服务器。
运行 `com.finebi.start.Learner`即可启动 BI 服务器。
## 插件调试安装
将插件的plugin.xml以及lib/FineKit-10.0.jar拷贝至webroot/WEB-INF/plugins/plugin-xxxxx下,即可完成插件安装。
编译工程后将插件的 plugin.xml 以及 lib/FineKit-10.0.jar 拷贝至 webroot/WEB-INF/plugins/plugin-xxxxx 下,即可完成插件安装。
## 新增插件项目

Loading…
Cancel
Save