Flexmonster Software License Agreement (“Agreement”) has been significantly revised and is effective as of September 30, 2024.
The following modifications were made:
The modified version of Flexmonster Software License Agreement is available here.
Downloading, installing, and/or continuing to use Flexmonster Software after September 30, 2024, constitutes Licensee’s acceptance of the terms and conditions of the modified version of Flexmonster Software License Agreement. If Licensee does not agree to any of these terms and conditions, they must cease using Flexmonster Software and must not download, install, use, access, or continue to access Flexmonster Software. By continuing to use Flexmonster Software or renewing the license under License Model or Maintenance after the effective date of any modifications to Agreement, Licensee accepts and agrees to be bound by the terms and conditions of the modified Agreement.
Flexmonster can select field types automatically. For example, check out the data:
let jsonData = [
{
"Country": "Canada",
"Price": 174,
}
];
By default, the types of the "Country"
and "Price"
fields will be set automatically to "string"
and "number"
, respectively.
You can manually set types for specific fields in one of the following ways:
You can use the mapping to define how fields are treated and presented within the component. See how to define the type of a field.
To set data types in JSON, you can add the first object with the necessary configurations in a JSON array. Check out the full list of supported properties.
See an example:
let jsonData = [
{
"Color": {type: "string"},
"Country": {
type: "string",
hierarchy: "Geography"
},
"State": {
type: "string",
hierarchy: "Geography",
parent: "Country"
},
"City": {
type: "string",
hierarchy: "Geography",
parent: "State"
},
"Price": {type: "number"},
"Quantity": {type: "number"}
},
{
"Color" : "green",
"Country" : "Canada",
"State" : "Ontario",
"City" : "Toronto",
"Price" : 174,
"Quantity" : 22
},
// Other data
];
const pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "node_modules/flexmonster/",
toolbar: true,
report: {
dataSource: {
data: jsonData
},
// Slice configs
}
});
Note If you use a JSON array of arrays, define field types in the first object. In that case, you do not need to specify fields in the first subarray Live example.
Check out the list of properties for configuring a field:
Property/Type | Description |
---|---|
type String | The data type. Check out the full list of available data types. |
hierarchy String | optional The hierarchy's name. When configuring hierarchies, specify this property to mark the field as a level of a hierarchy or as a member property of a hierarchy (in this case, the type property should be set to "property" ).See how to configure multilevel hierarchies. |
parent String | optional The unique name of the parent level. This property is necessary if the field is a level of a hierarchy and has a parent level. See how to configure multilevel hierarchies. |
isMeasure Boolean | optional Indicates whether a field can be selected only for measures (true ) or only for rows, columns, or report filters (false ). The isMeasure property works only when the strictDataTypes option is set to true
Live example.Default value: false . |
To specify that a field must be interpreted as a date, the field type must be set as one of the following:
"date"
"date string"
"datetime"
"year/month/day"
"year/quarter/month/day"
Note that Flexmonster must support the date format. Read more about input date formats.
You may be interested in the following articles: