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.
Unfortunately, activation email could not send to your email. Please try again.

Pie Chart Questions

Thread ID:

Created:

Updated:

Platform:

Replies:

116470 May 29,2014 10:16 PM Jun 6,2014 07:48 AM WinRT 3
loading
Tags: Chart
MagooChris
Asked On May 29, 2014 10:16 PM

Hi Syncfusion team,

 

I was wondering what would cause a Pie Chart to show as only a semi circle? It has only happened since upgrading to the 11.4.0.26 version. I've also copied the xaml out to a new project and that works perfectly, so I'm not sure what might be causing it.

 

Also, I was wondering if there is some way to bind the colours of the pie slices to something on the series itself? I'm hoping to use a few different controls using the same data and I would like the colours to line up per item (I want these colours to be chosen by the user per item so that they can tell just by colour what they are looking at).

 

Thanks for the help,

Regards,

Chris McHugh (@MagooChris)


Magesh Kumar Krishnan [Syncfusion]
Replied On May 30, 2014 04:48 AM

Hi MagooChris          

Thanks for using Syncfusion products.

Query 1: I was wondering what would cause a Pie Chart to show as only a semi circle? 

We have analyzed the reported issue and we are not able to reproduce issue. If possible can you share your sample or code snippet with screen shot of your sample with us, which would be much appreciable?

Query2: if there is some way to bind the colours of the pie slices to something on the series itself? 

You can achieve your requirement by using custom palette of Pie Chart series as shown in the below code snippet

Code snippet[Xaml]:

 <chart:PieSeries.ColorModel>
                    <chart:ChartColorModel>
                        <chart:ChartColorModel.CustomBrushes>
                            <SolidColorBrush Color="SkyBlue"></SolidColorBrush>
                            <SolidColorBrush Color="Gray"></SolidColorBrush>
                            <SolidColorBrush Color="Olive"></SolidColorBrush>
                            <SolidColorBrush Color="Violet"></SolidColorBrush>
                            <SolidColorBrush Color="Silver"></SolidColorBrush>
                            <SolidColorBrush Color="SaddleBrown"></SolidColorBrush>
                        </chart:ChartColorModel.CustomBrushes>
                    </chart:ChartColorModel>
                </chart:PieSeries.ColorModel> 

We have prepared the sample based on your requirement. Please find the  attached sample. 

Please let us know if you require further assistance on this.


Regards,

Magesh Kumar K


Attachment: Sample_707f9317.zip

MagooChris
Replied On June 5, 2014 03:03 AM

Hi Magesh Kumar K,

Thank you for the reply. I've copied my code outside of the app I'm working on and the pie chart seems to be fine there, I will do some more investigating, but it seems that it's something else on the page or maybe with my bindings that is causing the problem...

 

Also with Question 2, the code you have given here does not use bindings in any way. I need to be able to bind the colour of the pie chart segment to the data that it represents as the user will pick those colours and I will have no control in which order the data is placed in. Is there a way to do this with Data Binding to the item source not hard coded colour pallet?

 

Regards,

Chris McHugh


Mohammed Azarudeen [Syncfusion]
Replied On June 6, 2014 07:48 AM

Hi MagooChris,

 

We have analyzed your requirement and you  are  able to bind the colors value(custom brush colors) to ColorModel property of Pie series as shown the below code snippet.

 

CodeSnippet[C#]:

  

<chart:PieSeries  Palette="Custom"  x:Name="pieSeries" ColorModel="{Binding CustomBrush, Converter={StaticResource converter}}" ItemsSource="{Binding Data}"  XBindingPath="Country" YBindingPath="Count">

 

 

We have prepared a sample based on your requirement. Please find the sample under the following location

 

Regards,

Mohammed Azarudeen.


Attachment: PiechartColorBinding_c6043ff5.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;