How to group bar without stacking

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
iEnergy
Newbie
Newbie
Posts: 19
Joined: Thu Mar 11, 2010 12:00 am

How to group bar without stacking

Post by iEnergy » Wed Sep 29, 2010 10:38 am

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
Attachments
barseries.JPG
barseries.JPG (21.69 KiB) Viewed 3159 times

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

Re: How to group bar without stacking

Post by Narcís » Wed Sep 29, 2010 11:41 am

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());
                }
            }
        }
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

iEnergy
Newbie
Newbie
Posts: 19
Joined: Thu Mar 11, 2010 12:00 am

Re: How to group bar without stacking

Post by iEnergy » Thu Sep 30, 2010 8:48 am

Thanks

Post Reply