RadPolarChart Problem with circle size

9 posts, 1 answers
  1. linnet
    linnet avatar
    8 posts
    Member since:
    Dec 2010

    Posted 04 Jan 2013 Link to this post

    Hi!
    I'm using RadPolarChart and RadChart to create Decision Analysis Demo.
    On Attached file(charts.png) the Top-Left Chart is RadPolarChart uses RadialAxis.
    The label text is too long so circle size become small.
    If possible no wrap but circle can fill the grid.

    Here is my code:
    <UserControl.Resources>
        <Style x:Key="MajorTickStyle" TargetType="Rectangle">
            <Setter Property="Visibility" Value="Collapsed" />
        </Style>
        <Style x:Key="PolarAxisLabelStyle" TargetType="TextBlock">
            <Setter Property="Margin" Value="7,0,0,0" />
            <Setter Property="FontFamily" Value="Arial" />
        </Style>
        <Style x:Key="RadarAxisLabelStyle" TargetType="TextBlock">
            <Setter Property="Margin" Value="5" />
            <Setter Property="FontFamily" Value="Arial" />
        </Style>
    </UserControl.Resources>
    <telerik:RadPolarChart x:Name="RadPolarChart1" Grid.Row="0" Grid.Column="0" Margin="0">
        <telerik:RadPolarChart.Grid>
            <chartView:PolarChartGrid GridLineVisibility="Both" />
        </telerik:RadPolarChart.Grid>
        <telerik:RadPolarChart.RadialAxis>
            <chartView:CategoricalRadialAxis MajorTickStyle="{StaticResource MajorTickStyle}" LabelStyle="{StaticResource RadarAxisLabelStyle}" />
        </telerik:RadPolarChart.RadialAxis>
        <telerik:RadPolarChart.PolarAxis>
            <chartView:PolarAxis Minimum="0" Maximum="0.15" LabelInterval="3" LabelFormat="p2" LabelStyle="{StaticResource PolarAxisLabelStyle}" />
        </telerik:RadPolarChart.PolarAxis>
        <chartView:RadarAreaSeries>
            <chartView:RadarAreaSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="ABCDEFGHIJKLMN111111" Value="0.011" />
                <telerik:CategoricalDataPoint Category="BCDEFGHIJKLMNA111111" Value="0.011" />
                <telerik:CategoricalDataPoint Category="CDEFGHIJKLMNAB111111" Value="0.124" />
                <telerik:CategoricalDataPoint Category="DEFGHIJKLMNABC111111" Value="0.08" />
                <telerik:CategoricalDataPoint Category="EFGHIJKLMNABCD111111" Value="0.133" />
            </chartView:RadarAreaSeries.DataPoints>
        </chartView:RadarAreaSeries>
    </telerik:RadPolarChart>

    Thank you for the support.
  2. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 10 Jan 2013 Link to this post

    Hi Linnet,

    This is a known issue, which is already logged in our PITS where you can vote for it and track its status. I have attached a project to demonstrate one possible work-around for this. Examine the attachment and see if you can apply the suggested work-around in your actual app. This approach involves the RadialAxisLabelTemplate template, RadialAxisLabelStyle style and the RadPolarChart1_LayoutUpdated event handler, so please go through it carefully.

    Greetings,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 06 Feb 2013 Link to this post

    While this work-around works in the limited scenarios I have tested - it would be nice if you could fix it in the near future.
  5. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 19 Dec 2013 Link to this post

    I can see that this issue is marked as resolved in PITS.

    With the latest release the circle still becomes very small with long labels.

    The workaround is still necessary, but not ideal as it clips the labels.

    Any other solutions/workaround possible?

  6. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 24 Dec 2013 Link to this post

    Hi Jorn,

    Can you provide us with a snapshot of the result that you get so that we can see how the chart has arranged its elements. Perhaps you can use a label template which wraps the text in two or three rows (and a specific Width, say 50).

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  7. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 05 Feb 2014 in reply to Petar Marchev Link to this post

    Hello,

    Attached is three screenshots. One with default chart behaviour, second one with the workaround found earlier in this thread and the third with just applying a style like this:

                <Style x:Key="RadialAxisLabelStyle" TargetType="TextBlock">
                    <Setter Property="Width" Value="80"/>
                    <Setter Property="TextWrapping" Value="Wrap"/>
                    <Setter Property="Margin" Value="10,10,10,10"/>
                </Style>


    With the workaround the size and label layout is nice but the labels themselves are clipped. With styling it looks OK, but the short labels are wasting space by being a little too far from the chart (making the chart itself smaller).
  8. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 05 Feb 2014 Link to this post

    Hello Jorn,

    I am sorry to hear that you are still having problems with this. I have attached a modified version of the previous project to handle the default TextBlock instead of the Canvas in the DataTemplate. With this update, the TextBlock's alignment is toggled and the labels are positioned closer to the chart.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  9. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 05 Feb 2014 in reply to Petar Marchev Link to this post

    Thanks - I think this is acceptable. One last question - In our application the user is able to add/remove the datapoints (by filtering the result set). Should I leave the LayoutUpdated event since this only runs once now?
  10. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 05 Feb 2014 Link to this post

    Jorn,

    I think it will suffice if the code runs once each time the chart is rebound.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner