91
Views
9
Comments
Chart legend not matching with bar color
Application Type
Reactive
Service Studio Version
11.54.82 (Build 63748)

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. 


Captura de ecrã 2024-11-22 150016.png
2024-09-12 07-55-10
Sana Shaikh

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.

2025-06-30 15-03-37
Claudia Almeida

Hey,

I saw it but didn't help.

Thank you

2022-03-10 08-26-10
Cristian Angel Puma Villalva

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"    }}

  • colors: These are the colors for your bars and legend. Replace them with your preferred colors (hex codes or RGB).
  • plotOptions.column.stacking: This ensures the bars are stacked properly.
  • legend: Aligns and positions the legend at the bottom.


3. How to Add the JSON

  • Go to your chart widget in Service Studio.
  • Look for the AdvancedFormatOptions property.
  • Paste the JSON code above into that property.

2025-06-30 15-03-37
Claudia Almeida

Hi Cristian,

This is my code, do you think is wrong?

Captura de ecrã 2024-11-25 083156-.png
Captura de ecrã 2024-11-22 150016.png
2021-09-06 15-09-53
Dorine Boudry
 
MVP

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

2025-06-30 15-03-37
Claudia Almeida

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. 

Captura de ecrã 2024-11-25 081740.png
Captura de ecrã 2024-11-22 150016.png
Captura de ecrã 2024-11-25 083156-.png
2024-02-14 09-44-45
Omar Abd elkefi

Hello @Claudia Almeida ,

Please refer the this oml file below.

BarChartApplication.oml
2025-06-30 15-03-37
Claudia Almeida

Hi Omar, it's all fixed now.

But thank you anyway.

2025-09-08 01-32-11
Fiz


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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.