Sunburst Chart

Hi everyone,

has anyone created a working Sunburst Chart using ArcShapes? How to do this?

  • Radian = PI = 3.14159265359
  • inner circle (Root Segment) = 2 * Radian
    1. Generation (2 Parent Segments) = 1 * Radian
    1. Generation (4 Parent Segments) = Radian / 2
    1. Generation (8 Parent Segments) = Radian / 4
    1. Generation (16 Parent Segments) = Radian / 8

is this not similar to https://forum.xojo.com/35960-how-to-draw-fan-chart ?
Did that not work?

I am sure it’s possible with the ChartDirector Plugin from MBS.

Hi again,

[quote=323578:@Dirk C]is this not similar to https://forum.xojo.com/35960-how-to-draw-fan-chart ?
Did that not work?[/quote]

Nope Dirk, its another type of chart.

Thanks Sascha, but should be possible with Xojo native Engine :wink:


I found a nice Tutorial at Rod Stewards C# Blog to realize such a chart.

I tried to convert the C#-Code to Xojo. This is the current state.

I have problems to convert the DrawSunburstChild Method. Especially this section:

GraphicsPath path = new GraphicsPath(); path.AddArc(outer_rect, min_angle, max_angle - min_angle); path.AddLine(outer_max_x, outer_max_y, inner_max_x, inner_max_y); path.AddArc(inner_rect, max_angle, min_angle - max_angle); path.AddLine(inner_min_x, inner_min_y, outer_min_x, outer_min_y); path.CloseFigure();

If you have a look on Window1 theres a way to create Childs via FigureShapes and CurveShapes. How to make this working with DrawSunburstChild? Maybe someone will have fun to check my conversion and fix it.

Sunburst Chart Xojo-Project

Thanks and Greetings

I’m rather puzzled by this comment. The only difference is that one is a half circle and the other is a full circle, a trivial difference.

Actually, there are other differences. In particular, the sunburst chart can also have more than two segments in an outer ring for a given segment in an inner ring, and the sizes are possibly proportional to other quantities instead of strictly equal. But it should be possible–though not necessarily trivial–to rework the fan chart code for a sunburst.

True enough, but the basic calculations for creating the arcs and positioning and rotation of the text are the same.