Page 1 of 1

Set the interval between the Y axis scale

Posted: Thu Aug 27, 2015 3:43 am
by 16070928
Excuse me, how do I customize the settings for the Y axis scale, for example, I have a linear graph, as follows:
In this chart, I focus on the identification of the data for the "1", "2" of the data is secondary, but the "2" of the data accounted for most of the region. I want to achieve the "1" of the data in the display of the majority of the region, and the corresponding reduction of the "2" region. That is, in the "2" area (0-16), the interval of the Y axis scale is 4, while in the "1" area (16-22), the Y axis scale is 1. How to achieve this function. Thank you!
Sample.png
Sample.png (16.75 KiB) Viewed 5756 times

Re: Set the interval between the Y axis scale

Posted: Thu Aug 27, 2015 7:19 am
by narcis
Hi csi,

I'm not sure to understand your request correctly. You'd like to have different sections in an axis with different increment values and therefore different labels and ticks. Is that correct? That being the case, the only option I can think of to achieve that is using the GetAxisLabel event, for example:

Code: Select all

    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    private void InitializeChart()
    {
      tChart1.Series.Add(new Steema.TeeChart.Styles.Line());

      for (int i = 0; i < 100; i++)
      {
        tChart1[0].Add(i);        
      }

      tChart1.GetAxisLabel += TChart1_GetAxisLabel;
    }

    private void TChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
    {
      if (sender.Equals(tChart1.Axes.Left))
      {
        double tmp = Convert.ToDouble(e.LabelText);

        if ((tmp > 60) && (tmp % 4 != 0))
        {
          e.LabelText = "";
        }
      }
    }