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

RadPieChart Display Issue

5 Answers 211 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Tracy
Top achievements
Rank 1
Tracy asked on 30 Jan 2012, 11:08 PM
Hello,

I have a RadPieChart which not displaying the slices correctly when one slice is 100% and the other is 0%.  No color is being applied to the 100%. I am using a converter to color each slice a specific color but the converter is not getting called.

Note -- it works fine for all other variations of values.
<chart:RadPieChart Palette="{Binding Palette}" Height="{Binding Path=PieChartHeight}" Width="{Binding Path=PieChartWidth}"
                   >
     
    <chart:RadPieChart.Behaviors>
        <chartView:ChartTooltipBehavior Placement="Mouse"  HorizontalOffset="0" VerticalOffset="-1" />
    </chart:RadPieChart.Behaviors>
     
    <chart:RadPieChart.TooltipTemplate>
        <DataTemplate>
            <Grid>
                <Path Data="M-1236,-441 L-1180,-441 -1180,-424 -1228,-424 -1236,-424 z"
                  Stretch="Fill" Fill="White" Stroke="Gray" StrokeThickness="1" />
                <StackPanel Margin="4,3,4,9" >
                    <TextBlock Text="{Binding Value}"  FontFamily="Segoe UI" />
                </StackPanel>
            </Grid>
        </DataTemplate>                       
    </chart:RadPieChart.TooltipTemplate>
 
 
    <chartView:PieSeries ValueBinding="Value" ItemsSource="{Binding DataPoints}"
                         RadiusFactor="0.77"
                         >
 
        <chartView:PieSeries.LabelDefinitions>
            <chartView:ChartSeriesLabelDefinition Margin="-30,0,0,0" />
        </chartView:PieSeries.LabelDefinitions>
         
        <chartView:PieSeries.AngleRange>
            <charting:AngleRange StartAngle="10" SweepAngle="360" />
        </chartView:PieSeries.AngleRange>
         
        <chartView:PieSeries.SliceStyles>
             
            <Style TargetType="Path">
                <Setter Property="Stroke" Value="Gray"/>
                <Setter Property="StrokeThickness" Value="1"/>
                <Setter Property="Fill" Value="{Binding Converter={StaticResource pieChartSliceToColorConverter}, ConverterParameter=0}"/>
            </Style>
 
            <Style TargetType="Path">
                <Setter Property="Stroke" Value="Gray"/>
                <Setter Property="StrokeThickness" Value="1"/>
                <Setter Property="Fill" Value="{Binding Converter={StaticResource pieChartSliceToColorConverter}, ConverterParameter=1}"/>
            </Style>
 
            <Style TargetType="Path">
                <Setter Property="Stroke" Value="Gray"/>
                <Setter Property="StrokeThickness" Value="1"/>
                <Setter Property="Fill" Value="{Binding Converter={StaticResource pieChartSliceToColorConverter}, ConverterParameter=2}"/>
            </Style>
 
            
        </chartView:PieSeries.SliceStyles>
 
    </chartView:PieSeries>
 
</chart:RadPieChart>

Any help would be apprecieated.

Thanks,

Tracy Jenkins

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 02 Feb 2012, 09:05 AM
Hi Tracy,

Unfortunately we are not able to reproduce this issue in our local tests. The very basic scenario of binding the value of the setter works as expected. This is the code we've used to test this scenario :
<telerik:RadPieChart Name="pieChart">
            <telerik:PieSeries >
                <telerik:PieSeries.DataPoints>
                    <telerik:PieDataPoint Value="5" />
                    <telerik:PieDataPoint Value="0" />
                </telerik:PieSeries.DataPoints>
                <telerik:PieSeries.SliceStyles>
                    <Style TargetType="Path">
                        <Setter Property="Shape.Fill" Value="{Binding Item1}" />
                    </Style>
                    <Style TargetType="Path">
                        <Setter Property="Shape.Fill" Value="{Binding Item2}" />
                    </Style>
                </telerik:PieSeries.SliceStyles>
            </telerik:PieSeries>
        </telerik:RadPieChart>
public MainWindow()
        {
            InitializeComponent();
  
            this.pieChart.DataContext = new Tuple<Brush, Brush>(Brushes.Red, Brushes.Bisque);
        }

Our best guess in this case would be that the issue is in the color converter, however, we cannot confirm it at the moment without having a look at your full code. It would be very helpful if you're able to open a support ticket and send us a sample runnable project that reproduces the issue, so that we could debug it locally and track it down.

All the best,
Nikolay
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Tracy
Top achievements
Rank 1
answered on 02 Feb 2012, 05:00 PM
Here is a very simple sample which exhibits the problem.
Just create a wpf app, add a RadPieChart and change your data points to match the ones below.
I have attached a screenshot of what it looks like when the app is run.
<Window x:Class="RadPieChartSample.MainWindow"
        Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
        <telerik:RadPieChart HorizontalAlignment="Left" Margin="46,12,0,0" Name="radPieChart1" VerticalAlignment="Top" Height="275" Width="271">
            <telerik:PieSeries>
                <telerik:PieSeries.DataPoints>
                    <telerik:PieDataPoint Label="100 %" Value="100000" />
                    <telerik:PieDataPoint Label="0 %" Value="3" />
                </telerik:PieSeries.DataPoints>
            </telerik:PieSeries>
        </telerik:RadPieChart>
    </Grid>
</Window>
0
Nikolay
Telerik team
answered on 07 Feb 2012, 10:19 AM
Hi Tracy,

We have indeed been able to reproduce the issue you've encountered, the root cause is the wide range between the two data point values, e.g. 5000 and 1. It has been logged for our developers to investigate and provide a fix for one of the upcoming versions of the control. Meanwhile, we would suggest that in cases with such extreme ranges between the values it would be much more appropriate to use another series type, say Bar and use logarithmic vertical axis.

Your Telerik points have been updated for the feedback.

Greetings,
Nikolay
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Kaleb
Top achievements
Rank 1
answered on 26 Sep 2012, 07:08 PM
Hi,

We are experiencing similar problems so I'd like to inquire after the status of a solution to this.  Is it still forthcoming?  Is it resolved in some newer version of Telerik than we're using?

Thanks,

Kaleb
0
Nikolay
Telerik team
answered on 01 Oct 2012, 07:28 AM
Hello Kaleb,

This issue has already been resolved for a while now and you can have the fix by downloading a newer version of the control.

Greetings,
Nikolay
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
ChartView
Asked by
Tracy
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Tracy
Top achievements
Rank 1
Kaleb
Top achievements
Rank 1
Share this question
or