UI Builder - Color Script Does Not Change the Color of Data Visualization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 10:28 AM - edited 02-16-2024 10:32 AM
I have a data visualization that requires a use case to change the color of the visualization based on the metric through a repeater. That is why I am not using the static input for the visualization.
For testing purposes I am visualizing a random metric and have configured this script
/**
* {params} params
* {api} params.api
* {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
return {
color: "75ab0255b7610110c5aebc16de11a967", // sys_id of the color
metric: "YldWMGNtbGpRbUZ6WldOdFpHSmZZMmxmZDJsdVgzTmxjblpsY2pFM01EZ3hNRFl3TXpJMk56WT0xNzA4MTA2MDM0NjE2"
};
}
I am getting the sys_id of the color based off of this table: sys_report_color. When viewing the page the color doesn't change and is set to the default color.
I have tested for a static color input and viewed the json composition of the page.
I have checked if the sys_id of cyan really exists in the table and it does return a color
Any help will be appreciated and if there's additional info needed let me know.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 02:54 AM
@davmz I'm also trying to configure some custom colours for a data visualisation that I'm defining manual data for. Did you manage to find a solution here? You mention: "I have tested for a static color input and viewed the json composition of the page." How did you view the json composition of the page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 01:57 AM
@davmz I have thesame requirement. Were you able to change the colors eventually?