Axis ticks and labels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dev01
Newbie
Newbie
Posts: 4
Joined: Tue May 13, 2014 12:00 am

Axis ticks and labels

Post by Dev01 » Mon Dec 15, 2014 12:57 pm

Is it possible to have an Axis to display only tick marks an no labels?
It looks like when I set labels visible to false the ticks go away.
I am using WPF TeeChart 4.1.2014.5092

Thanks in advance.

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

Re: Axis ticks and labels

Post by Narcís » Tue Dec 16, 2014 9:44 am

Hello Dev01,

Yes, you can set label text to a blank space in the GetAxisLabel event, for example:

Code: Select all

    void tChart1_GetAxisLabel(object sender, GetAxisLabelEventArgs e)
    {
      if (sender.Equals(tChart1.Axes.Left))
      {
        e.LabelText = " "; 
      }
    }
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

Dev01
Newbie
Newbie
Posts: 4
Joined: Tue May 13, 2014 12:00 am

Re: Axis ticks and labels

Post by Dev01 » Wed Dec 17, 2014 8:58 am

Thanks Narcis. I know this works, but isn't there a clean way of doing it - like enabling only ticks without enabling the labels. Because technically we are using up memory for those invisible "white space" labels and I am not sure how will it get disposed.

Thanks,
Dev01

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

Re: Axis ticks and labels

Post by Narcís » Wed Dec 17, 2014 11:32 am

Hello Dev01,
Dev01 wrote:but isn't there a clean way of doing it - like enabling only ticks without enabling the labels.
Ok, I added your request to bugzilla (ID1052). Feel free to sign up and add yourself to the CC List to receive updates on the issue.
Dev01 wrote:Because technically we are using up memory for those invisible "white space" labels and I am not sure how will it get disposed.
The next TeeChart update, which will be published very soon, will cache those texts so only one object will be created for such labels. This will mean very little memory impact. Also bear in mind that the .NET Framework is a garbage collected environment and this job is done automatically when disposing an object although objects are immediately freed, it's garbage collector who does that task. Therefore you may see memory consumption oscillations in your application. At this thread you'll find a more in deep discussion on garbage collector and TeeChart.
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:

Re: Axis ticks and labels

Post by Narcís » Mon Feb 23, 2015 4:18 pm

Hello Dev01,
Narcís wrote:
Dev01 wrote:but isn't there a clean way of doing it - like enabling only ticks without enabling the labels.
Ok, I added your request to bugzilla (ID1052). Feel free to sign up and add yourself to the CC List to receive updates on the issue.
My colleague Christopher Ireland just reminded me that this is is already possible using the TickOnLabelsOnly property, e.g.:

Code: Select all

      Steema.TeeChart.Styles.Line series = new Steema.TeeChart.Styles.Line();

      tChart1.Aspect.View3D = false;
      tChart1.Series.Add(series);
      series.FillSampleValues();

      tChart1.Axes.Bottom.Labels.Visible = false;
      tChart1.Axes.Bottom.Ticks.Visible = true;
      tChart1.Axes.Bottom.TickOnLabelsOnly = false;
Many apologies for having missed this property and the inconvenience it may have caused.
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