Colors of stacked area series all the same

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
HarryM
Newbie
Newbie
Posts: 3
Joined: Thu Oct 11, 2007 12:00 am

Colors of stacked area series all the same

Post by HarryM » Tue Oct 16, 2007 1:19 pm

I noticed that stacked area series don't color correctly when generated in code. the entire stack gets the color of the last area series added.
I am new to the Teechart library and I may have missed something, but I spent several hours trying to figure out what to do and have each series a separate color, as works when using the Teechart editor.
Perhaps, I missed something obvious.

I am using Teechart v3. in VS2005

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

Post by Narcís » Tue Oct 16, 2007 1:33 pm

Hi HarryM,

I'm not able to reproduce the problem here using the code below. Could you please try if the code works fine at your end and modify it or send us a simple example project we can run "as-is" to reproduce the problem here?

Code: Select all

		private void Form1_Load(object sender, EventArgs e)
		{
			Steema.TeeChart.Styles.Area area1;

			for (int i = 0; i < 5; i++)
			{
				area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
				area1.FillSampleValues();
				area1.Stacked = Steema.TeeChart.Styles.CustomStack.Stack;
			}
		}
You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance!
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

HarryM
Newbie
Newbie
Posts: 3
Joined: Thu Oct 11, 2007 12:00 am

your sample works, but...

Post by HarryM » Tue Oct 16, 2007 1:53 pm

Thanks Narcis for looking into my little problem so quickly.
I have uploaded a RemObjects Chrome project (I hope that this not too much of a problem) wich I used for testing again and again without luck.

I translated your code sample into Chrome and it works well. The problem is when not using the the FillSamples method, and trying to add data programatically. There must be a way to tell each series to use a unique color. I just don't know where to look.

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

Post by Narcís » Tue Oct 16, 2007 2:31 pm

Hi HarryM,

Thanks for the example project. The problem with it is the UseOrigin property you have to set it to false or set a value for the Origin property as well, for example:

Code: Select all

  MArea1.UseOrigin:=true;
  MArea1.Origin:=500;
The same applies to MArea2.

Hope this helps!
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

HarryM
Newbie
Newbie
Posts: 3
Joined: Thu Oct 11, 2007 12:00 am

Ok, i get it now

Post by HarryM » Tue Oct 16, 2007 3:02 pm

Thanks for helping me on this one. I think i know better now.
Looks like it is going to work.

Post Reply