Metric User Script Configuration for a Line Data Visualization in UI Builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 08:37 AM - edited 01-15-2024 09:07 AM
So I am creating a Line Data Visualization Component and I am having trouble figuring out the script to add for the Metric, the Data Source I have figured out and works with other Data Visualization Components.
This is what the visualization looks like with these script configurations:
Data Source Script:
return [{
allowRealTime: true,
filterQuery: "###",
id: "###",
isDatabaseView: false,
sourceType: "table",
tableOrViewName: "###"
}];
return {
"trendByFields": [{
"field": "anything",
"metric": "###"
}],
"trendByFrequency": "date"
};
Metric Script:
return {
axisId: "primary",
dataSource: "###",
id: "###",
transforms: {
metric: "###",
transform: [{
name: "chart-subjects",
transform: "Reference"
}]
}
};
I have looked through the Page Definition and the composition JSON of a static input component to reference.
"metrics": {
"container": [
{
"container": {
"axisId": {
"type": "JSON_LITERAL",
"value": "primary"
},
"dataSource": {
"type": "JSON_LITERAL",
"value": "###"
},
"id": {
"type": "JSON_LITERAL",
"value": "###"
},
"numberFormat": {
"type": "JSON_LITERAL",
"value": {
"customFormat": false
}
},
"transforms": {
"type": "JSON_LITERAL",
"value": [
{
"metric": "###",
"transform": {
"name": "chart-subjects",
"transform": "Reference"
}
}
]
}
},
"type": "MAP_CONTAINER"
}
],
"type": "LIST_CONTAINER"
},
Any help will be great. Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 04:03 AM
Hi @davmz ,
I am facing the same issue did you find a solution for this?