Page 1 of 1

Bar series - Side All

Posted: Wed Nov 18, 2009 7:50 pm
by 14045174
I have a graph with multiple bar series and labels on the bottom axis. When I set Bar's stack option to "Side All" I have labels only below the first series, the rest of them have no labels at all.

Re: Bar series - Side All

Posted: Thu Dec 03, 2009 9:16 am
by yeray
Hi UserLS,

This has been fixed for the next v3 and v4 maintenance releases (TF02014567).

Re: Bar series - Side All

Posted: Tue Dec 15, 2009 3:35 pm
by 14045174
Yes, the labels are fixed (only if we are using labels, but if my bottom axis is showing dates - it is completely broken!). But now if I make my series marks visible and set marks.Style = Label... the first series generates marks for all points on the bottom axis with zeroes for the points, that belong to other series , the second series skips the first, but sure enough has its own "zero" marks over the following series and so on...
You will also have a very interesting results if you will change the first bar series AutoDepth = false and the depth set to something like 20. Especially, if any of the following series have a zero value for one of the points.

Re: Bar series - Side All

Posted: Fri Dec 18, 2009 11:54 am
by yeray
Hi UserLS,
UserLS wrote:Yes, the labels are fixed (only if we are using labels, but if my bottom axis is showing dates - it is completely broken!)
Yes, I could reproduce it with the following code so I've added it to the bug list to be fixed in next releases (TF02014600). Are you sure it was fine in a previous v3 maintenance release?

Code: Select all

            new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            Random rnd = new Random();
            DateTime date = new DateTime(2009, 12, 18);

            for (int ValueIndex = 0; ValueIndex < 3; ValueIndex++) 
            {                
                date = date.AddDays(1);
                for (int SeriesIndex = 0; SeriesIndex < tChart1.Series.Count; SeriesIndex++)                
                    tChart1[SeriesIndex].Add(date, rnd.Next(100));                
            }

            (tChart1[0] as Steema.TeeChart.Styles.Bar).MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll;
UserLS wrote:. But now if I make my series marks visible and set marks.Style = Label... the first series generates marks for all points on the bottom axis with zeroes for the points, that belong to other series , the second series skips the first, but sure enough has its own "zero" marks over the following series and so on...
You will also have a very interesting results if you will change the first bar series AutoDepth = false and the depth set to something like 20. Especially, if any of the following series have a zero value for one of the points.
If I understand well, the main problem would be the same that results in "zero" extra marks and the "depth issue". It seems that having SideAll, the first series is drawing bars with value 0 where the other bar series are going to be drawn. This produces these marks (having first series marks visible) and the depth issue. Here is a code to reproduce the problem.

Code: Select all

            new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            new Steema.TeeChart.Styles.Bar(tChart1.Chart);

            tChart1[0].Add(100);
            tChart1[0].Add(10);            

            tChart1[1].Add(8);
            tChart1[1].Add(0);

            tChart1[2].Add(8);
            tChart1[2].Add(0);

            (tChart1[0] as Steema.TeeChart.Styles.Bar).MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll;
            tChart1[0].Marks.Arrow.Color = Color.Green;
            (tChart1[0] as Steema.TeeChart.Styles.Bar).Depth = 20;
            tChart1[1].Marks.Visible = false;
            tChart1[2].Marks.Visible = false;   
I've added this too to the bug list to be fixed asap (TF02014601).

Re: Bar series - Side All

Posted: Thu Jan 07, 2010 3:13 pm
by yeray
Hi UserLS,

Studying TF02014600, we've realised that this is not a bug but a limitation in design. The SideAll style forces you to have the default X values (0, 1, 2,...) so the datetimes can't be used. Instead of adding your bars with X value like, for example:

Code: Select all

tChart1[SeriesIndex].Add(date, rnd.Next(100)); //public int Add(DateTime x, double y)
You could add the values with the date as label and show it:

Code: Select all

tChart1[SeriesIndex].Add(rnd.Next(100), date.ToShortDateString()); //public int Add(double value, string text)