Page 1 of 1

How to group bar without stacking

Posted: Wed Sep 29, 2010 10:38 am
by 15655406
Hi,

I would like to know how to create bar series and group them according to year but without stacking. I tried the Multibar property to side but it display's differently. Also is there a way to prevent the chart from using all the available space (scale based on the charts width). Please see attachment for the chart i want to accomplish.

Many Thanks

Re: How to group bar without stacking

Posted: Wed Sep 29, 2010 11:41 am
by narcis
Hi iEnergy,

Yes, you can do that as shown in the code snippet below. Setting BarWidthPercent to 100 seems to work wrongly though, I've added the issue (TF02015176) to the defect list to be fixed.

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Random y = new Random();

            for (int i = 0; i < 3; i++)
            {
                Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
                bar.MultiBar = Steema.TeeChart.Styles.MultiBars.Side;
                bar.Marks.Visible = false;
                bar.BarWidthPercent = 99;

                for (int j = 0; j < 3; j++)
                {
                    bar.Add(2010 + j, y.Next());
                }
            }
        }

Re: How to group bar without stacking

Posted: Thu Sep 30, 2010 8:48 am
by 15655406
Thanks