Request for Pie Chart Gradient Color for Xamarin Forms

Dear Syncfusion Team,


I hope this message finds you well. I am writing to request your assistance in implementing a custom gradient color for a pie chart in Xamarin Forms. I have attached a screenshots of the design I would like to achieve.


Screenshot 2023-09-06 at 7.13.30 PM.png

Screenshot 2023-09-06 at 8.02.24 PM.png


I have already reviewed your documentation on pie chart appearance in Xamarin Charts control . However, I was unable to find information on how to implement a custom gradient color for a pie chart.


Could you please provide me with guidance on how to achieve this? I would greatly appreciate any help you can offer.


Thank you for your time and assistance.


Sincerely,

Yaseen Wakeel


Attachment: DesignPieChart_f25e3fb4.zip

3 Replies

NT Nitheeshkumar Thangaraj Syncfusion Team September 7, 2023 12:56 PM UTC

Hi Ch,


Based on your query, you are expecting radial gradient support in SfChart, which is partially supported on Android and iOS. We will conduct further validation. The code snippet and images are provided below,


<chart:PieSeries.ColorModel>

                    <chart:ChartColorModel Palette="Custom">

                        <chart:ChartColorModel.CustomGradientColors>

                            <chart:ChartGradientColor StartPoint="0.5,1" EndPoint="0.5, 0">

                                <chart:ChartGradientColor.GradientStops>

                                    <chart:ChartGradientStop Color="#DCFA97" Offset= "0"/>

                                    <chart:ChartGradientStop Color="#96E6A1" Offset= "1"/>

                                </chart:ChartGradientColor.GradientStops>

                            </chart:ChartGradientColor>

                        </chart:ChartColorModel.CustomGradientColors>

                    </chart:ChartColorModel>

                </chart:PieSeries.ColorModel>





Further clarification, please refer the UG documentation link provided below,

https://help.syncfusion.com/xamarin/charts/appearance#gradient-colors


Please let us know if you need any further assistance.


Regards,

Nitheeshkumar.



YW Yaseen Wakeel replied to Nitheeshkumar Thangaraj September 11, 2023 08:50 AM UTC

Dear Syncfusion Team,


I appreciate your previous response regarding the Xamarin Forms Pie Chart Gradient Color. However, the provided code didn't fully meet my design requirements.


I have attached a screenshot of the provided code snippet for your reference. Could you please refine the code to match my design?


output.png


I kindly request that you provide an updated source code example in your next response to help me integrate the desired Pie Chart Gradient Color into my Xamarin Forms application.


Thank you for your assistance.


Sincerely,

Yaseen Wakeel


Attachment: PieChartSample_71682b8f.zip


NT Nitheeshkumar Thangaraj Syncfusion Team September 12, 2023 09:24 AM UTC

Hi Yaseen,


In the previous response, we missed including another color in the provided code snippet. We apologize for the miscommunication. We have added two different gradient colors for individual segments to achieve your requirement. We have also made changes in your sample and attached it for your reference.


<chart:PieSeries.ColorModel>

                    <chart:ChartColorModel Palette="Custom">

                        <chart:ChartColorModel.CustomGradientColors>

                            <chart:ChartGradientColor StartPoint="0.5,1" EndPoint="0.5, 0">

                                <chart:ChartGradientColor.GradientStops>

                                    <chart:ChartGradientStop Color="#DCFA97" Offset= "0"/>

                                    <chart:ChartGradientStop Color="#96E6A1" Offset= "1"/>

                                </chart:ChartGradientColor.GradientStops>

                            </chart:ChartGradientColor>

                            <chart:ChartGradientColor StartPoint="0.5,1" EndPoint="0.5, 0">

                                <chart:ChartGradientColor.GradientStops>

                                    <chart:ChartGradientStop Color="#DFFFD8" Offset= "0"/>

                                    <chart:ChartGradientStop Color="#DFFFD8" Offset= "1"/>

                                </chart:ChartGradientColor.GradientStops>

                            </chart:ChartGradientColor>

                        </chart:ChartColorModel.CustomGradientColors>

                    </chart:ChartColorModel>

                </chart:PieSeries.ColorModel>



If you need any further assistance, feel free to ask.


Regards,

Nitheeshkumar.


Attachment: PieChartSample_6942ad1d.zip


Loader.
Up arrow icon