stackedbars are floating

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
bruno
Newbie
Newbie
Posts: 4
Joined: Tue Oct 24, 2006 12:00 am

stackedbars are floating

Post by bruno » Mon Apr 28, 2008 8:23 am

When creating a stackedbar chart in the .NET v2 i get some weird behaviour.

Some bars seem to be floating on the chart. Meaning the y value of the bottom sracked value doesn't seem to be 0.
Also i get some overlapping of adjenct bars. They seem to take the distance between 2 x-values and when calculating the barwidth, they don't seem to take into account that there is a adjenct bar.

Can any one assist me with this problem please.

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

Post by Narcís » Mon Apr 28, 2008 8:50 am

Hi bruno,

Would you be so kind to send us a simple example project we can run "as-is" to reproduce the problem here? You can either 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

bruno
Newbie
Newbie
Posts: 4
Joined: Tue Oct 24, 2006 12:00 am

Uploaded sample.

Post by bruno » Mon Apr 28, 2008 9:03 am

Hi narcís,

I've uploaded the sample.
steema_Bruno_@_Narcís.zip through the public upload page.

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

Post by Narcís » Mon Apr 28, 2008 9:21 am

Hi bruno,

Thanks for the example project. I could reproduce the stacking problem. It seems that when a series doesn't have a value for a certain x value the other series use previous values of this series for stacking. I've added the defect (TV52013017) to our bug list to be fixed for next versions.

Regarding the overlapping problem, I couldn't reproduce it here using latest TeeChart for .NET v2 update build available at the client area. Could you please try if this version works fine at your end?

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

bruno
Newbie
Newbie
Posts: 4
Joined: Tue Oct 24, 2006 12:00 am

Playing with the example

Post by bruno » Mon Apr 28, 2008 10:01 am

Narcís,

I could get it to work when in order i added a transparent point as posted below.

tChart1.Series.Clear();

Bar Bananen = new Bar();
Bar appelen = new Bar();
Bar peren = new Bar();

tChart1.Series.Add(appelen);
tChart1.Series.Add(peren);
tChart1.Series.Add(Bananen);

Bananen.Marks.Visible = false;
Bananen.MultiBar = MultiBars.Stacked;
Bananen.Title = "Bananen";
Bananen.Add(1, 20);
Bananen.Add(2,15);
Bananen.Add();
Bananen.Add(4, 5);
Bananen.Add(5, 10);

peren.Marks.Visible = false;
peren.MultiBar = MultiBars.Stacked;
peren.Title = "Peren";
peren.Add(1, 20);
peren.Add(2, 15);
peren.Add();
peren.Add();
peren.Add();

appelen.Marks.Visible = false;
appelen.MultiBar = MultiBars.Stacked;
appelen.Title = "Appelen";
appelen.Add(1, 20);
appelen.Add(2, 15);
appelen.Add(3, 25);
appelen.Add(4, 25);
appelen.Add();

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

Post by Narcís » Mon Apr 28, 2008 10:17 am

Hi bruno,

I'm glad to hear you found a solution to the issue. This is because Add(), as doesn't have any value specified adds a zero value to the point.
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

bruno
Newbie
Newbie
Posts: 4
Joined: Tue Oct 24, 2006 12:00 am

Fix

Post by bruno » Mon Apr 28, 2008 12:05 pm

Can you please inform us when this fix is released?
The previous solution i used still has some issues with the minvalue not being initialised for a range of series.
Limiting the period with setminmax did not seem to do the trick.

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

Post by Narcís » Mon Apr 28, 2008 12:22 pm

Hi bruno,

I recommend you to be aware at this forum or subscribe to our RSS feed for new release announcements and what's fixed on them.

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

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

Post by Narcís » Wed May 21, 2008 7:37 am

Hi bruno,

We have been reviewing the stacked bars issue (TF02013015) and we don't think it is a bug. There's a simple workaround which consists in making sure that each series in the stack has the same number of points, adding in null points where necessary.

I've sent you an example project of this.
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

Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Post by Adrian » Wed May 21, 2008 8:48 am

Hi all,
I've just been reading through the forum and noticed this one which has caused me problems in the past (and I've posted on it several times). I do believe this to be a bug after all shouldn't tchart correctly align the values based on xaxis values rather than just ordinal position in the data source.

While there is a workaround it doesn't stop it from being a bug.
Adrian Heald
Captell Developments
www.captelldevelopments.com

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

Post by Narcís » Wed May 21, 2008 2:37 pm

Hi Adrian,

We will reopen the issue for investigation.
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

AIS
Newbie
Newbie
Posts: 70
Joined: Wed Jun 25, 2008 12:00 am

Post by AIS » Tue Nov 04, 2008 1:35 pm

Hi,

i have the same problem with the stacked bars in tchart. The workaround doesnt work in all situations. If a series have no first value like the others, there is a gap. Also it is possible, that some series have more then one value at the same x position.
I could not found any fix in the releasenotes.

example for series without a first value:

Code: Select all

Bar Bananen = new Bar();
Bar appelen = new Bar();
Bar peren = new Bar();

tcStatistic.Series.Add(appelen);
tcStatistic.Series.Add(peren);
tcStatistic.Series.Add(Bananen);

Bananen.Marks.Visible = false;
Bananen.MultiBar = MultiBars.Stacked;
Bananen.Title = "Bananen";
Bananen.Add(1, 20);
Bananen.Add(2, 15);
Bananen.Add(4, 5);
Bananen.Add(5, 10);
Bananen.Add();

peren.Marks.Visible = false;
peren.MultiBar = MultiBars.Stacked;
peren.Title = "Peren";
peren.Add(1, 20);
peren.Add(3, 15);
peren.Add();
peren.Add();
peren.Add();

appelen.Marks.Visible = false;
appelen.MultiBar = MultiBars.Stacked;
appelen.Title = "Appelen";
appelen.Add(2, 15); // no first value
appelen.Add(4, 25);
appelen.Add();
appelen.Add();
appelen.Add();
example for series with more values at same x position

Code: Select all

Bar Bananen = new Bar();
Bar appelen = new Bar();
Bar peren = new Bar();

tcStatistic.Series.Add(appelen);
tcStatistic.Series.Add(peren);
tcStatistic.Series.Add(Bananen);

Bananen.Marks.Visible = false;
Bananen.MultiBar = MultiBars.Stacked;
Bananen.Title = "Bananen";
Bananen.Add(1, 20);
Bananen.Add(1, 15); // second value on this position
Bananen.Add(2, 5);
Bananen.Add(4, 10);
Bananen.Add(5, 4);

peren.Marks.Visible = false;
peren.MultiBar = MultiBars.Stacked;
peren.Title = "Peren";
peren.Add(1, 20);
peren.Add(3, 15);
peren.Add();
peren.Add();
peren.Add();

appelen.Marks.Visible = false;
appelen.MultiBar = MultiBars.Stacked;
appelen.Title = "Appelen";
appelen.Add(1, 15);
appelen.Add(4, 25);
appelen.Add();
appelen.Add();
appelen.Add();
Thanks in advance!

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 Nov 04, 2008 2:55 pm

Hi AIS,

No, the issue hasn't been fixed yet. I've increased its priority on the list.

For the first example you can populate appelen series like this:

Code: Select all

			appelen.Marks.Visible = false;
			appelen.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
			appelen.Title = "Appelen";
			appelen.Add(1, 0, Color.Transparent);
			appelen.Add(2, 15); // no first value
			appelen.Add(4, 25);
			appelen.Add();
			appelen.Add();
			appelen.Add();
For the second example it doesn't make much sense to me that you use bar series like this. In that case you could either add both values as one single value (Add(1, 35)) or add same x value for another series. You could create a second "Bananen" series.
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

Post Reply