cbi-web-sdk

3.3.19 • Public • Published

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 });

Readme

Keywords

none

Package Sidebar

Install

npm i cbi-web-sdk

Weekly Downloads

8

Version

3.3.19

License

ISC

Unpacked Size

13.3 MB

Total Files

11

Last publish

Collaborators

  • zhengbiwen