原創|使用教程|編輯:鄭恭琳|2019-11-01 11:21:00.710|閱讀 390 次
概述:本示例說明如何從代碼中注冊JSON數據。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Stimulsoft Dashboards.JS是一個功能齊全的工具,用于為JavaScript平臺創建儀表板。要生成和查看儀表板,您需要任何支持HTML5和JavaScript的Web瀏覽器。當不需要服務器端時,它可以作為客戶端工作,也可以在服務器端使用服務器端。該軟件與Node.js完美兼容。
立即點擊下載Stimulsoft Dashboards.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>
在下面的屏幕截圖中,您可以看到示例代碼的結果。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn