This is a migrated thread and some comments may be shown as answers.

Gradient in pie chart series - how to remove?

6 Answers 426 Views
Chart
This is a migrated thread and some comments may be shown as answers.
kaczmar2
Top achievements
Rank 1
kaczmar2 asked on 18 Nov 2010, 12:17 AM
I am using a SolidColorBrush in my pie chart, but I still see some kind of gradient and band for each of the series items (see attached screenshot.  I assumed that SolidColorBrush would paint a solid pie slice.  How can I achieve this?

6 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 18 Nov 2010, 12:42 PM
Hello Christian Kaczmarek,

The shadow which you see is a mask over the pie. The palette brushes functionality does not remove the masks and that is why you need to retemplate your pie in order to have them removed. Please check the attached project.

Kind regards,
Sia
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
kaczmar2
Top achievements
Rank 1
answered on 18 Nov 2010, 10:32 PM
Thank you for the sample.  I was able to integrate it into the pie chart and the chart looks exactly how I need it.  Thank you again.
0
Saravanan
Top achievements
Rank 1
answered on 15 Jul 2011, 10:06 AM
Thank you,
 
i have some questions,
 
1.how to position the item label style in center ?..why its always in corner  ?
 
2.Can we reduce the radius size ?,i want to reduce the size to very small
 
3.how to change gradient circle shape from circle to ellipse ?
  (i want to show bubble effect) l
 
please find the attachment here..
 
Thanking you,
Saravanan
0
Sia
Telerik team
answered on 19 Jul 2011, 12:36 PM
Hello Saravanan,

Straight to your questions:
 
1. How to position the item label style in center ?..why its always in corner  ?

You can reduce the label offset and position you labels inside the pie slices. For example:
<telerik:SeriesMapping.SeriesDefinition>
    <telerik:PieSeriesDefinition ItemLabelFormat="#VAL %" ItemStyle="{StaticResource CustomPieStyle}">
        <telerik:PieSeriesDefinition.LabelSettings>
            <telerik:RadialLabelSettings LabelOffset="0.5" />
        </telerik:PieSeriesDefinition.LabelSettings>
        <telerik:PieSeriesDefinition.InteractivitySettings>
            <telerik:InteractivitySettings HoverScope="Item" SelectionMode="Single" SelectionScope="Item"/>
        </telerik:PieSeriesDefinition.InteractivitySettings>
    </telerik:PieSeriesDefinition>
</telerik:SeriesMapping.SeriesDefinition>
Different settings can be observed in our "Smart Labels" demo.

2. Can we reduce the radius size ?,i want to reduce the size to very small
You can reduce the pie size by changing the RadiusFactor default value as follows:
<telerik:PieSeriesDefinition ItemLabelFormat="#VAL %" ItemStyle="{StaticResource CustomPieStyle}" RadiusFactor="0.5">

3. How to change gradient circle shape from circle to ellipse ? (i want to show bubble effect)
You need to modify the mask over the pie by setting custom style, which can be found in the attached project. The RadialGradientBrush which needs to be modified is:
<RadialGradientBrush x:Key="PieMaskBrush" GradientOrigin="0.5,0.5">
    <GradientStop Color="#33FFFFFF" Offset="0.88"/>
    <GradientStop Color="#00FFFFFF" Offset="0.65"/>
    <GradientStop Offset="0.89"/>
</RadialGradientBrush>

I hope this helps.

Greetings,
Sia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Saravanan
Top achievements
Rank 1
answered on 19 Jul 2011, 02:58 PM
Thank you very much Team,
  
  
Quesion 1:
  
i am showing value in terms of Percentage.(100%)
  
but when give data like this..
  
             ObservableCollection<TradeData> tradeData = new ObservableCollection<TradeData>();
             tradeData.Add(new TradeData { Name = "name1", Count = 80 });
             tradeData.Add(new TradeData { Name = "name3", Count = 80});
             return tradeData;
  
it shows what i give but its wrong i thing ..how should i avoid this..
  
Question 2:
  
 How should i show the display message "No Data Series" when two series value is Zero ?
               ObservableCollection<TradeData> tradeData = new ObservableCollection<TradeData>();
             tradeData.Add(new TradeData { Name = "name1", Count = 0});
             tradeData.Add(new TradeData { Name = "name3", Count = 0});
            return tradeData;
its shows 0%,0%,i want to hide this one..
  
please find the attachement here
  
  
    
0
Sia
Telerik team
answered on 22 Jul 2011, 01:40 PM
Hello Saravanan,

Can you please give us some more details about your first question because with the present information we are not sure what causes your problem?

Regarding your second question, you need to set the chart's itemsource to null when all values are 0.
RadChart.ItemsSource = null;

Another option is to hide the zero values by setting:
(seriesMapping1.SeriesDefinition as PieSeriesDefinition).LabelSettings.ShowZeroValueLabels = false;


All the best,
Sia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Chart
Asked by
kaczmar2
Top achievements
Rank 1
Answers by
Sia
Telerik team
kaczmar2
Top achievements
Rank 1
Saravanan
Top achievements
Rank 1
Share this question
or