load(url: String, requestHeaders: Object)
[starting from version: 1.4]
Loads the report file from the specified URL.
url
– String. The URL to the report file.requestHeaders
optional – Object. Allows you to add custom request headers when loading a report from a server. This object consists of "key": "value"
pairs, where "key"
is a header’s name and "value"
is its value.1) Load local report:
flexmonster.load("data/reports/report2.json");
2) Load remote report:
flexmonster.load("http://yourserver.com/script_which_returns_report_json.php");
Open the example on JSFiddle.
3) Load a report from a resource that requires specific request headers (e.g., authorization headers):
flexmonster.load("http://yourserverwithauth.com/report_json.php",
{
AuthToken: "XXXX"
}
);
open
save
getReport
setReport
shareReport
Save and restore the report