cbi-web-sdk
v3.3.19
Published
cbi-web-sdk
Downloads
20
Readme
Example Usage
1. script 标签引入
<div id="container" style="width: 100%; height: 100%">
Loading...
</div>
<link rel="stylesheet" href="/your-path/bi-web-sdk.min.css">
<script src="/your-path/lodash.min.js"></script>
<script src="/your-path/leaflet.js"></script>
<script src="/your-path/echarts.min.js"></script>
<script src="/your-path/bi-web-sdk.min.js"></script>
<script>
window.addEventListener('load', () => {
// 设置配置
BI.setConfig({
language: "pt_PT",
webUrl: "https://cleverbi-ng.percent.cn/",
serverUrl: "https://cleverbi-ng-service.percent.cn/api/subject",
mapResourceUrl: "/map-resource"
});
// 报告分享 id
const linkId = 'xxx';
// 创建一个报告
new BI.Report('container', { linkId });
});
</script>
2. webpack 构建
import * as BI from 'cbi-web-sdk';
import 'cbi-web-sdk/cjs/bi-web-sdk.min.css';
BI.setConfig({
language: "zh_CN",
webUrl: "https://cleverbi-ng.percent.cn/",
serverUrl: "https://cleverbi-ng-service.percent.cn/api/subject",
mapResourceUrl: "/map-resource"
});
// 报告分享 id
const linkId = 'xxx';
// 创建一个报告
new BI.Report('container', { linkId });