PieChart Padding

Dec 4, 2014 at 11:02 PM
Edited Dec 4, 2014 at 11:03 PM
Hi,

im searching since two days and still couldnt find a way to set the Padding value.

I want to see the PieSeries directly at the Border from the red Chart square. How can i do this?

Image
Coordinator
Dec 4, 2014 at 11:30 PM
Looking at the code and with the Visual Tree Debugger in the toolkit (run the sample app from the toolkit's solution and press Ctrl+Shift on chart samples) you can see multiple places where padding is used
{TemplateBinding Padding} takes care of the padding you set on the Chart control itself
Margin="0,15,0,15" is set hard-coded on a grid in the Chart template - you could use Padding="0,-15" to hack/fix that easily
The PieSeries has a default Margin="10,10,10,10" set in its style - you can set it to 0 on the instance of the PieSeries
The one part that might be hardest to fix is there's this method in PieSeries.cs called UpdatePieDataPointGeometry that sets the diameter of the pie slice to 95% of min(width,height) of available plotArea size... You could try to divide the chart dimensions by .95 or you could modify the source code and recompile.
Marked as answer by Helge on 12/4/2014 at 4:35 PM
Dec 4, 2014 at 11:35 PM
thanks a lot for this Infos.
i changed the Margin from the Series directly in XAML to -10. without touching the sourcecode. works perfectly.