Page 1 of 1

Axis ticks and labels

Posted: Mon Dec 15, 2014 12:57 pm
by 15669247
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.

Re: Axis ticks and labels

Posted: Tue Dec 16, 2014 9:44 am
by narcis
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 = " "; 
      }
    }

Re: Axis ticks and labels

Posted: Wed Dec 17, 2014 8:58 am
by 15669247
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

Re: Axis ticks and labels

Posted: Wed Dec 17, 2014 11:32 am
by narcis
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.

Re: Axis ticks and labels

Posted: Mon Feb 23, 2015 4:18 pm
by narcis
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.