Page 1 of 1

Is a Sankey Diagram possible?

Posted: Thu Nov 24, 2011 2:24 pm
by 15657467
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

Re: Is a Sankey Diagram possible?

Posted: Fri Nov 25, 2011 12:33 pm
by yeray
Hello Kushal Kolli,

You could try with Shapes series, Arrow series or depending on the design desired, Area series.

Re: Is a Sankey Diagram possible?

Posted: Fri Nov 25, 2011 2:13 pm
by 15657467
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

Re: Is a Sankey Diagram possible?

Posted: Fri Nov 25, 2011 4:09 pm
by 15657467
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

Re: Is a Sankey Diagram possible?

Posted: Tue Nov 29, 2011 11:23 am
by yeray
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.

Re: Is a Sankey Diagram possible?

Posted: Tue Nov 29, 2011 1:19 pm
by 15657467
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

Re: Is a Sankey Diagram possible?

Posted: Thu Dec 01, 2011 2:50 pm
by yeray
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.