Hi all I am using charts in Outsystems 011 without components from Forge. I have a Stacked Column Chart whose stacked colors do not match the colors in the legend.
I want to these colors to be the same without using Forge components. I don't know JSON despite having used it for the stack and subtitles.
I tried searching forum but I am unable to find solutions for this version that works.
Hello @Claudia Almeida,
Please refer below link, it is similar to your issue.
https://www.outsystems.com/forums/discussion/88309/legend-color-is-different-with-bar-chart/
Hope this helps.
Hey,
I saw it but didn't help.
Thank you
Hi! The issue where the legend colors don’t match the bar colors in a Stacked Column Chart can be fixed by adjusting the advanced settings. Here’s how you can do it:
1. Check Your Chart Configuration
First, make sure you’re using a Stacked Column Chart in your Reactive app and that your data series are properly defined.
2. Sync the Colors Using JSON
To ensure the legend colors match the bar colors, you’ll need to use the Advanced Format Options property. This is where you can customize your chart with JSON.
Here’s a simple JSON example you can use:
jsonCopy code{ "plotOptions": { "column": { "stacking": "normal" } }, "colors": ["#FF5733", "#33FF57", "#3357FF"], "legend": { "align": "center", "verticalAlign": "bottom", "layout": "horizontal" }}
3. How to Add the JSON
Hi Cristian,
This is my code, do you think is wrong?
Hi Claudia,
you'll need to share what version of charts you are using, and how you are populating / configuring it.
A typical mistake that can cause this, is that people define series colors in the SeriesStyling addon (charts V3.x), but give the datapoints other colors when populating datapoints for the chart.
Dorine
Hi Dorine,
This is what I have so far, can you help with this information?
I added legend part to the code but didn't work. Although I may have done it wrong.
Hello @Claudia Almeida ,
Please refer the this oml file below.
Hi Omar, it's all fixed now.
But thank you anyway.
Hello Claudia,Can i know how did you solve this issue? i have the same issue , about the color of legends didnt match the bar chart eventhough i changed to version 1. Wish you could help.Thank you in advance.