Page 1 of 1

stackedbars are floating

Posted: Mon Apr 28, 2008 8:23 am
by 9642872
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.

Posted: Mon Apr 28, 2008 8:50 am
by narcis
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.

Uploaded sample.

Posted: Mon Apr 28, 2008 9:03 am
by 9642872
Hi narcís,

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

Posted: Mon Apr 28, 2008 9:21 am
by narcis
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.

Playing with the example

Posted: Mon Apr 28, 2008 10:01 am
by 9642872
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();

Posted: Mon Apr 28, 2008 10:17 am
by narcis
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.

Fix

Posted: Mon Apr 28, 2008 12:05 pm
by 9642872
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.

Posted: Mon Apr 28, 2008 12:22 pm
by narcis
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.

Posted: Wed May 21, 2008 7:37 am
by narcis
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.

Posted: Wed May 21, 2008 8:48 am
by 9637403
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.

Posted: Wed May 21, 2008 2:37 pm
by narcis
Hi Adrian,

We will reopen the issue for investigation.

Posted: Tue Nov 04, 2008 1:35 pm
by 13049497
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!

Posted: Tue Nov 04, 2008 2:55 pm
by narcis
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.