How do I set Labels Increment

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

How do I set Labels Increment

Post by Dave » Mon Dec 02, 2013 11:01 pm

Hi there

This is a very similar question to my previous one.
I am adding labels programmatically using C#.Net (see below)

However when I zoom-in I don't see any labels
How do I make my custom labels behave in a similar way to the default labels? ie. when you zoom-in you see labels at the new scale

TIA
----------------------

int count1 = theChart.Series[0].XValues.Count;
theChart.Axes.Bottom.Labels.Items.Clear();

int z1 = 0;
while (z1 < count1)
{
string m = (count1 - z1).ToString();
theChart.Axes.Bottom.Labels.Items.Add(z1, m);
++z1;
}

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How do I set Labels Increment

Post by Sandra » Tue Dec 03, 2013 10:28 am

Hello Dave,

I have tried to reproduce problem using your custom labels code in a simple c# code:

Code: Select all

 public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }
    private void InitializeChart()
    {
      Steema.TeeChart.Styles.Line line1 = new Line(tChart1.Chart);
      line1.FillSampleValues();
      AddCustomLabels(); 

    }
     private void AddCustomLabels()
     {
       int count1 = tChart1.Series[0].XValues.Count;
       tChart1.Axes.Bottom.Labels.Items.Clear();

       int z1 = 0;
       while (z1 < count1)
       {
         string m = (count1 - z1).ToString();
         tChart1.Axes.Bottom.Labels.Items.Add(z1, m);
         ++z1;
       }
    }
And Axes labels doesn't disappear for me. For this reason, I would be very grateful if you could arrange for us a simple project where the problem appears, because we can reproduce it here and try to give you a good solution.

Thanks,
Best Regards,
Sandra Pazos / 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