Hi everyone,I have a dashboard that displays charts using data from a database. The charts represent different entities, and I filter the data to create stacks in bar charts based on these entities. I have also added an entity attribute called attribute_color, for example, language and lang_color. I have encountered an issue where the bar stacks display the correct colors, but the legend at the bottom of the chart appears in grey and does not reflect the assigned colors.Please provide your guidance.Thank you.
Hello folks,I understood what part I was doing wrong.In the outsystems chart reference, I was using Charts_Version_1 instead of Charts and Addons.It is working fine now.Thankyou for all your responses.
Hi @Zinee Gulhane ,
If possible, could you please share your OML file? I will review it and get back to you with my findings.
Thanks,
Vipin Yadav
Unfortunately, I can't share the OML file but will try to provide a sample soon. Thanks!
Hi @Vipin Yadav I am attaching a demo OML below.Please help me with regard to this.Thank you!
I have checked your OML file, and it is working fine.
Demo URL - https://vyadav.outsystemscloud.com/Demo/SampleLegendColor
However, in your case, the issue might be related to the data. It’s possible that the Language Id is not present in the CompleteData2 table, which is why the color is not showing. Please check the data and let me know if anything is unclear.
Hi @Zinee Gulhane
Try to pass the name of colors in the color attributeRegards,
Faiz
As in my example, for Language entity, I have 3 languages with specific color for each. This is why I have assigned the color via entity attribute. If I write the color directly, it might not differ across 3 languages, right?Do you have any input on this?Thanks!
Refer below Links.
https://www.outsystems.com/forums/discussion/75167/where-can-i-change-the-colors-of-each-dataseriesname-in-chart-widget/
https://www.outsystems.com/forums/discussion/95193/outsystems-charts-bar-chart-series-marker-color-reactive/
if possible share your OML.
Regards ,
Rajat
Unfortunately, I can't share the OML file but will try to provide a sample soon. Will check above links.Thanks!
Hi @Rajat Agrawal I am attaching a demo OML below.Please help me with regard to this.Thank you!
Set colors explicitly in the chart config to sync the legend.
Hello @Zinee Gulhane ,
You have assigned colors to individual data points but not to the series as a whole. As a result, the chart is automatically generating colors for each series. In OutSystems, using the version of the chart component you implemented, colors are typically defined within the data arrays by default. To specify the color attribute outside the data arrays, customization is required using a JSON configuration.
Here are some helpful links: