Stimulsoft Dashboards.JS教程:为仪表板模板注册数据

本示例说明如何从代码中注册JSON数据。

Stimulsoft Dashboards.JS是一个功能齐全的工具,用于为JavaScript平台创建仪表板。要生成和查看仪表板,您需要任何支持HTML5和JavaScript的Web浏览器。当不需要服务器端时,它可以作为客户端工作,也可以在服务器端使用服务器端。该软件与Node.js完美兼容。

本示例说明如何从代码中注册JSON数据。

<script type="text/javascript">    // Set full screen mode for the viewer    var options = new Stimulsoft.Viewer.StiViewerOptions();    options.appearance.scrollbarsMode = true;    options.appearance.fullScreenMode = true;    // Create the dashboard viewer with specified options    var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);    var report = Stimulsoft.Report.StiReport.createNewDashboard();    // Load dashboard from url    report.loadFile("../dashboard/Dashboard.mrt");    // Create new DataSet object    var dataSet = new Stimulsoft.System.Data.DataSet("Demo");    // Load JSON data file from specified URL to the DataSet object    dataSet.readJsonFile("../dashboard/Demo.json");    // Remove all connections from the dashboard template    report.dictionary.databases.clear();    // Register DataSet object    report.regData("Demo", "Demo", dataSet);    // Show dashboard in the Viewer    viewer.report = report;</script>

在下面的屏幕截图中,您可以看到示例代码的结果。

Stimulsoft Dashboards.JS教程:为仪表板模板注册数据

下载示例代码

标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2019年10月1日
下一篇 2019年10月1日

相关推荐

发表回复

登录后才能评论