.NET 1.1: Stacked Bar

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Casper JH Erasmus
Newbie
Newbie
Posts: 17
Joined: Wed Oct 13, 2004 4:00 am
Location: South Africa

.NET 1.1: Stacked Bar

Post by Casper JH Erasmus » Fri May 11, 2007 11:51 am

Hi,

I've uploaded an file called "BarGraph.bmp". How do I created a stacked bargraph like the one in the bitmap image.

Thanks

Regards,
Casper JH Erasmus

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

Post by Narcís » Fri May 11, 2007 12:05 pm

Hi Casper,

The easiest way I can think of to achieve that is making bar's pen not visible and using some code like this:

Code: Select all

		private void Form1_Load(object sender, EventArgs e)
		{
			tChart1.Aspect.View3D = false;

			for (int i = 0; i < 4; i++)
			{
				Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
				bar1.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
				bar1.ColorEach = true;
				bar1.BarWidthPercent = 100;
				bar1.Marks.Visible = false;
				bar1.Pen.Visible = false;
			}

			tChart1[0].Add(1, 1, Color.Red);
			tChart1[1].Add(1, 1, Color.Yellow);
			tChart1[2].Add(1, 2, Color.Purple);
			tChart1[3].Add(1, 1, Color.Turquoise);

			tChart1[0].Add(2, 1, Color.Red);
			tChart1[1].Add(2, 2, Color.Blue);
			tChart1[2].Add(2, 1.5, Color.Lime);
			tChart1[3].Add(2, 0.5, Color.Gray);
		}
Is this acceptable for you?
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

Casper JH Erasmus
Newbie
Newbie
Posts: 17
Joined: Wed Oct 13, 2004 4:00 am
Location: South Africa

Post by Casper JH Erasmus » Fri May 18, 2007 11:44 am

Narcis,

Thank you, unfortunately my customer changed some of the requirements and this type of stacked bar is not necessary anymore.

Thank you for your effort. I appreciated it.

Regards,
Casper JH Erasmus

Post Reply