RadPieChart Display Issue

6 posts, 0 answers
  1. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 30 Jan 2012 Link to this post

    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
  2. Nikolay
    Admin
    Nikolay avatar
    386 posts

    Posted 02 Feb 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 02 Feb 2012 Link to this post

    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>
  5. Nikolay
    Admin
    Nikolay avatar
    386 posts

    Posted 07 Feb 2012 Link to this post

    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 >>
  6. Kaleb
    Kaleb avatar
    8 posts
    Member since:
    Jul 2012

    Posted 26 Sep 2012 Link to this post

    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
  7. Nikolay
    Admin
    Nikolay avatar
    386 posts

    Posted 01 Oct 2012 Link to this post

    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.

Back to Top
UI for WPF is Visual Studio 2017 Ready