0
votes

I've been using TeeChart Pro .NET 2010, and I noticed that when I have a Line series added to a chart, the minimum and maximum values are what is displayed on the chart. But when I enable 'Stairs' in the 'Line Mode' options for the line1 series, I get a subtle inflation on the chart axes.

This inflation does not change the minimum and maximum ranges for the axes. It appears similar to when 'Points' (visible markers at the xy points on the graph) are added to the chart. With 'Points', you have the option to enable/disable the inflation of the margins, but with 'Stairs', it is not so obvious.

I was wondering if anyone knew how to disable the inflation occurring when enabling 'Stairs' on a line series?

1

1 Answers

0
votes

This looks like some space to fit maximum and minimum flat segments. This may be reduced using axis MinimumOffset and MaximumOffset, for example:

  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    private Steema.TeeChart.Styles.Line line1;

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;

      line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
      line1.FillSampleValues();
    }

    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
      line1.Stairs = checkBox1.Checked;

      line1.GetVertAxis.MinimumOffset = (line1.Stairs) ? -line1.LinePen.Width : 0;
      //line1.GetVertAxis.MaximumOffset = line1.GetVertAxis.MinimumOffset;
    }
  }