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

PieChart - Reverse Slice Direction

3 Answers 123 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 12 Mar 2011, 05:09 PM
Hi there,

Currently the Rad Pie Chart (seems) to start at the 3 o'clock position, and draws each slice in a counter-clockwise direction.

Is it possible to change the direction to clockwise?

Is it possible to start at the 12 o'clock position?

Some background:  We are displaying data in our application, and representing it in a Telerik Rad PieChart, and then exporting the data to Microsoft Excel 2010 via OpenXml, and creating a pie chart in Excel.  Because Excel starts drawing its pie chart at the 12 o'clock position (which can be changed by adjusting the angle of the first slice), and draws the slices clockwise, it looks different than the Telerik Rad PieChart in our application, which isn't a very good user experience.  So, we're hoping we can change the direction that the Telerik Rad PieChart draws its pie slices, and where it starts drawing its first slice.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 16 Mar 2011, 03:24 PM
Hi Gary,

You can change the start position of the first pie slice by using the exposed StartAngle property of RadChart PieSeriesDefinition:
series.Definition = new PieSeriesDefinition() { StartAngle=40 };

Unfortunately it is not possible to change the direction of the pie slices. Your scenario seems reasonable and we will include this in our planning.  Please find your issue logged as feature request in our Public Issues Tracking System.

Kind regards,
Sia
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Gary
Top achievements
Rank 1
answered on 16 Mar 2011, 04:29 PM

Hi, thanks for your response Sia!

I was able to use the StartAngle property, so thank you for that.

After a little digging around in the documentation, I ran across the "ExportToImage" method, which I may end up using.  There is also a "ExportToExcelML" method, and a "ExportToXps" method.

 

using (MemoryStream stream = new MemoryStream())
{
   // Telerik RadChart ExportToImage => .png
   pieChart.ExportToImage(stream);
   Bitmap bitmap = new Bitmap(stream);
}

 
As for reversing the direction of the pie chart, I was able to achieve this by flipping the order of the palette brushes, and flipping the order of the ItemSource.

<!-- Brushes to use when rendering the chart -->
<telerik:RadChart.PaletteBrushes>
    <!---->
    <!-- Original Order
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource CompletedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource NotRunRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource PassedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource FailedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource BlockedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource NotImplementedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource NotApplicableRadialBrush}}" />-->
    <!---->
    <!-- Reversed Order -->
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource NotApplicableRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource NotImplementedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource BlockedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource FailedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource PassedRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource NotRunRadialBrush}}" />
    <DrawingBrush Drawing="{Binding Drawing, Source={StaticResource CompletedRadialBrush}}" />
</telerik:RadChart.PaletteBrushes>
0
Sia
Telerik team
answered on 16 Mar 2011, 05:02 PM
Hi Gary,

This is nice as workaround. You can track the status of the logged feature request when you log into our website and when the issue is resolved you can remove this tricky code from your project.

Best wishes,
Sia
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Chart
Asked by
Gary
Top achievements
Rank 1
Answers by
Sia
Telerik team
Gary
Top achievements
Rank 1
Share this question
or