change color at runtime for chart
Question

Hi All,

Is it possible to change the chart color at runtime as per the attached image below.



Regards,

Ellakkiya.S

Hi,

Here i got solution for your query,

Please find attached OML,

Regards,

Komal

Charts.oml

Hi,


Please add refresh get data of source as per this screen shot and try again.


Thanks

Hi,

Do you want to select the color of chart at browser or change the color at service studio ?

Regards,

Komal

Hi  Komal Kumbhar,

Thankyou for reply,

I want to select and change the color of the chart in browser.


Regards,

Ellakkiya.S


Hi  Ellakkiya Selvadurai,

Here I have created a sample charts demo for updating the color of chart at run time , have a look here,

https://komal-k.outsystemscloud.com/ChartsDemo/Charts.aspx

Also you can give color like this for multiple fields, I have given for Negative in charts,

Please find attached OML,


ChartsDemo.oml

Hi Komal Kumbhar,

Thankyou for reply

I saw your oml. But i am developing reactive web application, so i can't able to refresh the chat.

How it can be done for reactive web application?


Regards,

Ellakkiya.S



Hi Ellakkiya,

In Reactive apps you can't use the refresh but like the name says just change a value in the chart source and it will automatically change. 

Basically, change the color value in the source list and the chart will change.

Hope it helps,

Ricardo Pisco.

Hi,

Use data refresh of source entity of chart in apply action that will reflect the color in chart.

Regards,

Komal

Hi Ricardo Pisco,

Thankyou for your reply.

As you mentioned i have the change the color value in the source list. But it's not reflecting

for reference, Herewith i have attached the oml.


Regards,

Ellakkiya.S

 


reactivewebappcolorpalette.oml

Hi Komal Kumbhar,

Thankyou for your reply.

Refreshing the source list also doesn't work.

Please find the attached oml in above post.


Regards,

Ellakkiya.S


Hi,


Please add refresh get data of source as per this screen shot and try again.


Thanks

Hi Kaustubh Joshi,

Is it possible to bring the gradient color for pie chart to differentiate each sector 

Before selecting color

After selecting the color 

Here, when I change the color, there is no difference between the each sector.

Is it possible to bring the difference between sectors


Regards,

Ellakkiya.S

Hi,

You need to assign different colors for different section of your chart like in my shared oml I have 3 scetions negative positive and netural and in color tab of chart I have added if condition for 3 section. 

For your query you need to assign the different colors to different scetion at run time itself. You can use local variables for no of sections and assign color for particular section in it and refresh the source entity.

It willl reflect the color.

Regards,

Komal



IMG20210323WA0026.jpg

Hi Komal Kumbhar,

I need to get the gradient of the particular selected color and need to assign it dynamically to the chart to differentiate each sector.

Is it possible? how it can be done

Regards,

Ellakkiya.S

Hi,

For gradient color to whole pie chart or bar chart you need to do as follow,

1. Add drop down on screen and add the fields of chart to it.

2. Add input filed beside it and select the color as variable of it.

3. Add input parameter to the action of apply button and assign the selected value of field from drop down to input field of apply action.

4. In action, use switch to differ the color of each field add condition "Inputfield = field of chart" and then assign color to variable and refresh the data.

you can give the gradient shade to each field.

Please see in attached OML

Check here, https://komal-k.outsystemscloud.com/DateDemo/UpdateData?_ts=637521855298920965

Regards,

Komal

GradientChart.oml

Hi,

Here i got solution for your query,

Please find attached OML,

Regards,

Komal

Charts.oml

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