Is a Sankey Diagram possible?

Ideas and wishes for TeeChart
Post Reply
Kushal Kolli
Newbie
Newbie
Posts: 4
Joined: Mon Oct 11, 2010 12:00 am

Is a Sankey Diagram possible?

Post by Kushal Kolli » Thu Nov 24, 2011 2:24 pm

Hey all,

Is it possible to make a Sankey Diagrams using TeeChart for .NET 2010. Please help with any ideas and suggestions.

The main concern is that with the changing data, the input and output arrows should resize themselves so that they do not overlap each other.

Waiting for ideas.
Kushal Kolli

Yeray
Site Admin
Site Admin
Posts: 9611
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Is a Sankey Diagram possible?

Post by Yeray » Fri Nov 25, 2011 12:33 pm

Hello Kushal Kolli,

You could try with Shapes series, Arrow series or depending on the design desired, Area series.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Kushal Kolli
Newbie
Newbie
Posts: 4
Joined: Mon Oct 11, 2010 12:00 am

Re: Is a Sankey Diagram possible?

Post by Kushal Kolli » Fri Nov 25, 2011 2:13 pm

Hi Yeray,

If I were to make something like the image shown below. What would you suggest I make use of, I don think making use of the arrows is such a good idea.

Just to give you an idea, Sankey diagrams are used to visualize flow quantities in process systems with the inward arrows representing the input and the outward arrows representing the output. Now, depending on the data and the amount of each input and output, the width of the arrows are to be varied. Please suggest some solution around this. I am experimenting with placing 3D shapes on the Chart but I was hoping there could be a better solution to this.

With Regards
Kushal
Attachments
Sankey Flow Diagram.JPG
The Sankey Flow Diagram
Sankey Flow Diagram.JPG (21.48 KiB) Viewed 50158 times

Kushal Kolli
Newbie
Newbie
Posts: 4
Joined: Mon Oct 11, 2010 12:00 am

Re: Is a Sankey Diagram possible?

Post by Kushal Kolli » Fri Nov 25, 2011 4:09 pm

Hey Yeray,

I wanted to know how is an arc made. I do not understand the constructor( StartX,StartY,EndX,EndY,StartAngle,SweepAngle ). Could you also guide me with construction of arc.

And how do you make an inverted triangle with its tip facing downward.

Thank You.

With Best Regards
Kushal Kolli

Yeray
Site Admin
Site Admin
Posts: 9611
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Is a Sankey Diagram possible?

Post by Yeray » Tue Nov 29, 2011 11:23 am

Hi Kushal Kolli,

I'm afraid there isn't any TeeChart series supporting this kind of graphs directly. However, the Shapes series would let you draw the rectangular parts without many problems.
As you've seen, the most problematic will be drawing the curved shapes. The Graphics3DGdiPlus.Arc method creates a rectangle with the first four parameters and calls the .NET Framework DrawArc method:
http://msdn.microsoft.com/en-us/library ... awarc.aspx

I'm afraid the triangles should also be drawn manually.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Kushal Kolli
Newbie
Newbie
Posts: 4
Joined: Mon Oct 11, 2010 12:00 am

Re: Is a Sankey Diagram possible?

Post by Kushal Kolli » Tue Nov 29, 2011 1:19 pm

Hi Yeray,

What I do not understand is how the arc is made using the constructors that the Arc() has.

I have found an algorithm that would mark points for the whole curved arrow and then using the Polygon(params Point[] P), I am able to form a 2D arrow but if I want to make it 3D, is it possible? So I have a function which gives an array of the points along the arrow borders, which I use in the Polygon to draw a 2D shape. How do I make the polygon 3D. If that is possible then I could do away with what I have.

Please suggest.

With Best Regards
Kushal Kolli

Yeray
Site Admin
Site Admin
Posts: 9611
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Is a Sankey Diagram possible?

Post by Yeray » Thu Dec 01, 2011 2:50 pm

Hi Kushal Kolli,
Kushal Kolli wrote:What I do not understand is how the arc is made using the constructors that the Arc() has.
What constructors? The parameters in the methods from the .NET Framework are explained in the link mentioned above. I'd do dome simple tests to see how they work.
Kushal Kolli wrote:I have found an algorithm that would mark points for the whole curved arrow and then using the Polygon(params Point[] P), I am able to form a 2D arrow but if I want to make it 3D, is it possible? So I have a function which gives an array of the points along the arrow borders, which I use in the Polygon to draw a 2D shape. How do I make the polygon 3D. If that is possible then I could do away with what I have.
Try using the Calc3DPos method to transform each 2D point to its coordinates considering a Z depth.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply