Labels on bottom axis

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

Labels on bottom axis

Post by UserLS » Mon Nov 02, 2009 9:55 pm

I happen to have a graph with labels on the bottom axis. The labels are long, so to see the text I've rotated them by 315 degrees...

In Win32 I was getting the following result, which was fine:
Labels Win32.jpg
Labels Win32.jpg (7.55 KiB) Viewed 5172 times
But the same graph under .NET does not work. The default behavior is broken and I cannot find any way to fix if (and no custom code, please! My users do not know how to write it!)
Labels .NET.jpg
Labels .NET.jpg (8.5 KiB) Viewed 5174 times

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

Re: Labels on bottom axis

Post by Yeray » Tue Nov 03, 2009 3:11 pm

Hi UserLS,

I've been able to reproduce it and I've added it to the wish list to be improved in future releases (TF02014529). In the meanwhile, you could use OnGetAxisLabels event to workaround this doing something similar to this:

Code: Select all

        void Bottom_GetAxisDrawLabel(object sender, Steema.TeeChart.GetAxisDrawLabelEventArgs e)
        {
            if (checkBox1.Checked)
            {
                if ((tChart1.Axes.Bottom.Labels.Angle > 90) & (tChart1.Axes.Bottom.Labels.Angle < 180))
                {
                    e.Y = e.Y + 20;
                }
                else if ((tChart1.Axes.Bottom.Labels.Angle > 180) & (tChart1.Axes.Bottom.Labels.Angle < 270))
                {
                    e.Y = e.Y + 20;
                }
                else if ((tChart1.Axes.Bottom.Labels.Angle > 270) & (tChart1.Axes.Bottom.Labels.Angle < 360))
                {
                    e.Y = e.Y + 20;
                    e.X = e.X + 15;
                }
            }
        }
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: Labels on bottom axis

Post by UserLS » Mon Nov 30, 2009 10:09 pm

Besides the fact that this code looks very strange (why 20 pixels? why 15 pixels? Should it depend on the fonts?), I did add it and assigned event to the axis, but the event is fired only when graph is physically shown on your screen. Doing it in memory does not trigger the event even when calling the Draw() method. Also, if my bottom axis has a title and I am not showing anything below the graph (i.e. legend, footer, subfooter) than the suggested code makes my title disappear...
And this is just one of possibly several axes on the graph with different problems for each. Bottom line - can you guys fix your bugs, please?

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

Re: Labels on bottom axis

Post by Yeray » Fri Dec 04, 2009 4:06 pm

Hi UserLS,

We have been investigating the issue and a fix for it is quite complicated as involves important code modifications. We will continue investigating it for future releases.
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