This object contains configurations that will be applied to all reports in WebDataRocks. If needed, you can override global configurations in a report.
Check out how global configurations are saved in a report: Saving the report with global configs.
Name | Type | Description |
---|---|---|
dataSource | Data Source Object | optional Contains information about the data source. |
options | Options Object | optional Defines the view and functionality available for users. |
localization | String|Object | optional Sets a localization. For more details, refer to the language localization tutorial. |
1) Setting a data source that will be used in all reports:
const pivot = new WebDataRocks({ container: "#wdr-component", global: { dataSource: { type: "json", filename: "https://cdn.webdatarocks.com/data/data.json" } } });
See the full code on CodePen.
2) Setting options to make all reports read-only:
const pivot = new WebDataRocks({ container: "#wdr-component", global: { options: { grid: { showFilter: false, showReportFiltersArea: false, }, configuratorButton: false, drillThrough: false, sorting: "off", }, } });
Check out a live demo on CodePen.
3) Setting a localization that will be applied to all reports:
const pivot = new WebDataRocks({ container: "#wdr-component", global: { localization: "https://cdn.webdatarocks.com/loc/es.json" } });
See an example on CodePen.
4) Overriding global configurations in the report:
const pivot = new WebDataRocks({ container: "#wdr-component", global: { dataSource: { type: "json", data: // Inline JSON data }, options: { grid: { showFilter: false, }, configuratorButton: false, sorting: "off", }, }, report: { dataSource: { type: "csv", filename: "https://cdn.webdatarocks.com/data/data.csv" }, options: { grid: { showFilter: true, }, configuratorButton: true, }, } });
Try it out on CodePen.