RadPieChart unable to set Styles

3 posts, 1 answers
  1. Stefano
    Stefano avatar
    9 posts
    Member since:
    Jul 2012

    Posted 19 Jul 2011 Link to this post

    Hi,
    i've recently updated my project with the Q2 release of RadControls for Windows Phone 7 (2011.2.712.1037) and i have an issue with the styling of a RadPieChart.
    I have this following code:
    <chart:RadPieChart Margin="66,152,6,210" d:LayoutOverrides="Height">
        <chart:PieSeries LabelOffset="80" ShowLabels="True" ItemsSource="{Binding Series}">
            <chart:PieSeries.Styles>
                <Style TargetType="Path" BasedOn="{StaticResource BasePieStyle}">
                    <Setter Property="Fill" Value="#FF37FF00"/>
                </Style>
     
                <Style TargetType="Path" BasedOn="{StaticResource BasePieStyle}">
                    <Setter Property="Fill" Value="Red"/>
                </Style>
            </chart:PieSeries.Styles>
        </chart:PieSeries>
    </chart:RadPieChart>

    Everything worked since the update, but now the PieSeries.Styles property became PieSeries.Style and accepts only a value. My problem is i want to set exactly those two colors to my two slices of pie and i don't know how to proceed. I've checked on the example project that's been installed with the Q2 package but it's compiled against an older version of the DLL.
    Thanks
    Stefano Driussi
  2. Answer
    Georgi
    Admin
    Georgi avatar
    296 posts

    Posted 20 Jul 2011 Link to this post

    Hello Stefano,

    Thank you for contacting us.

    We changed the name of the Styles property to SliceStyles which we believe to be more meaningful. So, the code should look like:

    <chart:RadPieChart Margin="66,152,6,210" d:LayoutOverrides="Height">
        <chart:PieSeries LabelOffset="80" ShowLabels="True" ItemsSource="{Binding Series}">
            <chart:PieSeries.SliceStyles>
                <Style TargetType="Path" BasedOn="{StaticResource BasePieStyle}">
                    <Setter Property="Fill" Value="#FF37FF00"/>
                </Style>
      
                <Style TargetType="Path" BasedOn="{StaticResource BasePieStyle}">
                    <Setter Property="Fill" Value="Red"/>
                </Style>
            </chart:PieSeries.SliceStyles>
        </chart:PieSeries>
    </chart:RadPieChart>

    I hope this helps, do not hesitate to write us back should you have any other questions/problems.

    Kind regards,
    Georgi
    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!

  3. DevCraft banner
  4. Stefano
    Stefano avatar
    9 posts
    Member since:
    Jul 2012

    Posted 27 Jul 2011 Link to this post

    Thanks a lot, that solved the problem.
Back to Top