Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

UI Builder - Color Script Does Not Change the Color of Data Visualization

davmz
Tera Contributor

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.

davmz_1-1708107519715.png

 

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.

davmz_2-1708107967024.png

 

 

I have tested for a static color input and viewed the json composition of the page.

davmz_0-1708107890817.pngdavmz_1-1708107894615.png


I have checked if the sys_id of cyan really exists in the table and it does return a color

davmz_1-1708108357588.png

 

Any help will be appreciated and if there's additional info needed let me know.

Thanks

2 REPLIES 2

Bernard Esterhu
Tera Expert

@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?

pbalaraju
Tera Contributor

@davmz I have thesame requirement. Were you able to change the colors eventually?