How to change the color of charts or select as defined in database?

Hi, I’m building charts with new beta chart blocks in containers, I want to customize the color of the charts but I don’t see any option. There are options in the style panel to select single, as defined in datasource and randoms. But when I choose as defined in the data source those don’t work. I have tried the custom code but no results.

I tried this:

<script> 
window['chart1-colors'] = ['#FFFF00', '#FF0000', '#008000', '#0000FF'];
</script>

Anyone can help, thank you!!

Hi,
This is supposed to be an upcoming additional native feature for new charts.

For custom code => nothing to give as the chart css selectors are all unstable (they can change from week to week suddenly)

2 Likes

Hi, I see it now, thank you for the quick support, good to hear the team is working on it.

Is there any update on when this will be available? At the moment the chart colours don’t look right especially when the chart is showing status fields with random colours

1 Like

Is there an update on this? I’ve been trying to get my chart colors to work as per the data source and using CSS but nothing works. I’m guessing that the chart CSS selectors are still unstable? Can we expect an update soon?

Hi,
Regarding the selectors for charts, please refer to the Softr documenation here:

I’ve tried all of these and they don’t work - they work for a second but then the screen refreshes or I hover over the chart and the colors go back to the default ones.

I have a range of tickets that have a severity level set i.e. Critical, High, Med, Low, Info and then I need one if this field is blank (or to exclude that one). I have a table that shows all these severity ratings and the colors are pulled through from my data source (ClickUp) and they all work perfectly.

I created a chart but I can’t get it to work with my data source (apparently this will be a couple of months away) so I tried to set the custom css to change the colors but it jumps around too much e.g. I want critical = #e50000, high = #ff7800 etc. - if there’s no critical tickets at that time the colors all get moved around so they don’t make sense.

I asked ChatGPT to help and none of the suggested answers would work.

I’ve asked support and they said I can’t get it to work the way i want it to.

Any help would be greatly appreciated but I think I’ve hit a wall with it.