I created a fetchChartData action and set its output parameter (named out1) to the data type "Legacy_DataPoint List." In this action, I created an aggregate and assigned output parameters accordingly.
I then set the sourceDataPointList property to fetchChartData.out1.
I’m able to get the colors for the columns of the chart, but I’m not seeing the colors for the legends.
Can anyone help me figure out how to get the correct colors for the legends? Where could I have gone wrong?
Any guidance would be greatly appreciated!
Hi @Pavani Vislavath ,
I have added below post link might be helpful for you -
https://www.outsystems.com/forums/discussion/101201/how-to-add-custom-colors-for-column-chart-legend-data-points/#Post440221
Thanks,
Vipin Yadav
You can change the legend colors using JavaScript to customize your chart. In OutSystems, default properties might not automatically apply colors to the legends when you customize the columns.
Here’s an approach you can try:
Add a Custom JavaScript Block:Insert a JavaScript block in the same area where your chart is displayed.
Set Legend Colors:Use the following example code to set the colors. Assuming you're using a Highcharts-based chart (commonly used in OutSystems):
var chart = $public.Charts.GetChart("chartId"); // Replace "chartId" with your chart's ID chart.update({ legend: { itemStyle: { color: '#333333', // Change the legend text color fontWeight: 'bold', } }, series: [ { name: 'Series 1', color: '#FF0000', // Color for Series 1 }, { name: 'Series 2', color: '#00FF00',// Color for Series 2 } ] });
Ensure the Correct Chart ID:This code works if you correctly identify the chart's ID. You can inspect the chart element in your browser to find the ID.
Additionally, here are some resources with more examples:
CRISTIAN PUMA
For each series, add the series addon in the chart, that addon can get the color set.
Don't color individual datapoins if you want a whole series in the same color
@Pavani Vislavath
Better check the OutSystems Charts application is UpToDate if not make sure it is updated.
In Service Studio on right-top corner you can find a bell-Icon for update.
hi @Pavani Vislavath ,
check this post https://www.outsystems.com/forums/discussion/88309/legend-color-is-different-with-bar-chart/