Page 1 of 1

Tornado-plots using horizontal bars

Posted: Wed May 07, 2008 7:00 am
by 7667185
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

Posted: Wed May 07, 2008 7:58 am
by narcis
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);

Posted: Thu May 08, 2008 1:40 pm
by 7667185
Riight of course, didnt think of using stacked bars for horizontal bars :) Thanks!