Page 1 of 1
Colors of stacked area series all the same
Posted: Tue Oct 16, 2007 1:19 pm
by 13047011
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
Posted: Tue Oct 16, 2007 1:33 pm
by narcis
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!
your sample works, but...
Posted: Tue Oct 16, 2007 1:53 pm
by 13047011
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.
Posted: Tue Oct 16, 2007 2:31 pm
by narcis
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!
Ok, i get it now
Posted: Tue Oct 16, 2007 3:02 pm
by 13047011
Thanks for helping me on this one. I think i know better now.
Looks like it is going to work.