Page 1 of 1

How do I set Labels Increment

Posted: Mon Dec 02, 2013 11:01 pm
by 13050364
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;
}

Re: How do I set Labels Increment

Posted: Tue Dec 03, 2013 10:28 am
by 10050769
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,