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

Removed wasted space surrounding pie chart

2 Answers 47 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ted
Top achievements
Rank 1
Ted asked on 25 Jun 2013, 12:48 AM
I've got a pie chart (With a black background)

<Chart:RadPieChart x:Name="PieChartLoansTopPerformers"
                   Grid.RowSpan="2"
                   Grid.Column="0"
                   ClipToBounds="True"
                   PaletteName="DefaultDark"
                   FontSize="8"
                   Width="250"
                   Height="250"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   VerticalContentAlignment="Top"
                   HorizontalContentAlignment="Left"
                   PlotAreaStyle="{StaticResource plotStyle}"
                   Background="Black">
    <Chart:PieSeries x:Name="pieSeries"
                     ShowLabels="False"
                     ItemsSource="{Binding NetIncomeByLoanOfficer}"
                     ClipToPlotArea="True"
                     RadiusFactor="0.5">
        <Chart:PieSeries.ValueBinding>
            <Chart:PropertyNameDataPointBinding PropertyName="measure" />
        </Chart:PieSeries.ValueBinding>
        <Chart:PieSeries.LegendTitleBinding>
            <Chart:PropertyNameDataPointBinding PropertyName="dimension" />
        </Chart:PieSeries.LegendTitleBinding>
    </Chart:PieSeries>
</Chart:RadPieChart>



And a style for the PlotArea (To give it a gray background)

<Style x:Key="plotStyle"
       TargetType="Border">
    <Setter Property="Background"
            Value="Gray" />
</Style>


And it gives me this result:

http://i.imgur.com/xEBgoiv.png

My issue is the incredible amount of black space surrounding the actual plot. Tons of wasted space that I can not figure out how to get rid of. We don't have an AutoStyle property like the ASP.NET controls. On the SilverLight boards I read that you should style the PlotArea, but the plotarea is just the tiny part in the middle.

How can I get the pie chart to fill the entire space taken by this control?

Best,
Ted

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosy Topchiyska
Telerik team
answered on 25 Jun 2013, 11:28 AM
Hello,

Thank you for your question.

I can see that you have set the Background of the chart series to Gray, but the Background of the chart itself is Black. Since you have set the RadiusFactor of your only series to 0.5, the plot area takes the size of this series area, which is smaller (actually half size) than the chart area. If you wish the backgrounds to have the same color, then you have to set the Background of the chart to Gray in your case (and the styling of the plot area becomes unnecessary).

Moreover, I have noticed that you have set some properties that do not affect the appearance of your chart:

  • FontSize has no effect;
  • Vertical/HorizontalContentAlignment has no effect.

I hope this helps, and please, let me know if you need further assistance.

Regards,
Rositsa Topchiyska
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Ted
Top achievements
Rank 1
answered on 25 Jun 2013, 06:02 PM
Yes I set the backgrounds to different colors so I could see where the element borders were.

The RadiusFactor was the setting I was looking for! I'm working on XAML that was initially written by another developer. Not sure why he set that to 0.5. Thank you for your prompt answer!
Tags
Chart for XAML
Asked by
Ted
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Ted
Top achievements
Rank 1
Share this question
or