Bar series - Side All

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Bar series - Side All

Post by UserLS » Wed Nov 18, 2009 7:50 pm

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.
Attachments
Bars - side all.jpg
Bars - side all.jpg (23.55 KiB) Viewed 6442 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Bar series - Side All

Post by Yeray » Thu Dec 03, 2009 9:16 am

Hi UserLS,

This has been fixed for the next v3 and v4 maintenance releases (TF02014567).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Re: Bar series - Side All

Post by UserLS » Tue Dec 15, 2009 3:35 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Bar series - Side All

Post by Yeray » Fri Dec 18, 2009 11:54 am

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).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Bar series - Side All

Post by Yeray » Thu Jan 07, 2010 3:13 pm

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)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply