We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Bar colors based on value

Hi,

I'm experimenting with your MAUI charts, and I wonder whether it's possible to set the bar color of a chart depending on the value. 

I have seen the question below in the Xamarin forum - is this possible in MAUI?

Thank you

https://www.syncfusion.com/forums/132100/column-chart-change-column-color


3 Replies

RR Raja Ramalingam Syncfusion Team December 23, 2022 05:48 AM UTC

Hi Paul,

Greetings from Syncfusion support.

Query:
Is it possible to set the bar color of a chart depending on the value?

We are glad to inform you that Maui chart allows you to customize the segment color of the column series based on the y-value.

To know how to do this, please visit this kb article on "How to customize the segment color based on the Y value in MAUI Chart (SfCartesianChart)?"

https://www.syncfusion.com/kb/13661/how-to-customize-the-segment-color-based-on-the-y-value-in-maui-chart-sfcartesianchart

Note: If you want to apply value-based coloring while dynamically updating a data point, you must also update the brush collection. I have attached the sample of this for your reference.

To know more about palette brushes, please check this UG documentation.

https://help.syncfusion.com/maui/cartesian-charts/appearance#custom-palettebrushes


Please let us know if you have any additional questions on the topic.

Regards,

Raja.


Attachment: MAUI_Chart_Segment_Color_503beb79.zip


PA Paul December 23, 2022 02:12 PM UTC

Thanks Raja, that's working well!




PR Preethi Rajakandham Syncfusion Team December 27, 2022 05:28 AM UTC

Hi Paul,

We are glad that the provided response meets your requirement. Please let us know if you need further assistance. As always, we are happy to help you out.  

Regards,

Preethi R


Loader.
Live Chat Icon For mobile
Up arrow icon