DataSourceObject
DataSourceObject describes how to connect to your data source and which mapping should be applied to the data.
Properties
Property/Type | Description |
---|---|
idString | optionalThe unique identifier of the data source. If not specified, the id is autogenerated. |
typeString | optionalThe type of the data source. Possible values: "csv" , "json" , "flexmonster" . If not specified, the type will be autodetected. |
parserConfigParserConfigObject | optional Describes how to parse your JSON or CSV data. |
dataObject[] | [][] | optional Inline JSON data. |
urlString | optional The URL to the Flexmonster server, or to a file or a server-side script with JSON or CSV data. |
nameString | optional The name of a data source from the Flexmonster server. |
mappingMappingObject | optional The mapping configuration for the data source. |
requestHeadersObject | Contains request headers that will be added to the request sent when data is loaded via the url . |
Example
const dataSource = {
url: "ws://localhost:9501/",
name: "sales"
};
const dataset = {
id: "dataset-0",
dataSource: dataSource
};
const state = {
id: "state-0",
dataset: dataset
};
const flexmonster = fm3.Controls.Flexmonster("#pivot-container", {
state: state
});