Tornado-plots using horizontal bars

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Marius
Newbie
Newbie
Posts: 44
Joined: Thu Jan 31, 2008 12:00 am

Tornado-plots using horizontal bars

Post by Marius » Wed May 07, 2008 7:00 am

Is it possible to place two horizontal bars on the same y-axis value? In effect, having one negative bar and one positive bar located on the same height? I know I could probably join the two series from one's min to the other's max, but I want to have different colors on negative and positive values.

Thanks in advance!

Marius

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed May 07, 2008 7:58 am

Hi Marius,

Yes, you can do something like this:

Code: Select all

        com.steema.teechart.styles.HorizBar horizBar1 = new com.steema.teechart.styles.HorizBar(chart1.getChart());
        com.steema.teechart.styles.HorizBar horizBar2 = new com.steema.teechart.styles.HorizBar(chart1.getChart());
        
        horizBar1.setMultiBar(MultiBars.STACKED);
        horizBar2.setMultiBar(MultiBars.STACKED);
        
        horizBar1.add(10,0);
        horizBar2.add(-5,0);
        
        horizBar1.add(8,1);
        horizBar2.add(-9,1);
        
        horizBar1.add(2,2);
        horizBar2.add(-3,2);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marius
Newbie
Newbie
Posts: 44
Joined: Thu Jan 31, 2008 12:00 am

Post by Marius » Thu May 08, 2008 1:40 pm

Riight of course, didnt think of using stacked bars for horizontal bars :) Thanks!

Post Reply