Scale is not automatically adjusted for Finantial Functions

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Scale is not automatically adjusted for Finantial Functions

Post by Quant » Fri Apr 24, 2015 5:28 am

Dear Steema,
We are using some finantial functions of Teechart.NET . while using this we notice that the axis on which the function is ploted doesnt adjust its range automatically if i set it to automatic.This occures when i scale axis other than on which function is plotted. kindly refer follwing code which is of ADX Function.

Code: Select all

                tChart1.Axes.Bottom.Automatic = true;
                tChart1.Axes.Left.Automatic = false ;

                Steema.TeeChart.Styles.FastLine tFastLine1 = new Steema.TeeChart.Styles.FastLine();
                tFastLine1.VertAxis = VerticalAxis.Left;

                Steema.TeeChart.Functions.ADXFunction tADXFunction = new Steema.TeeChart.Functions.ADXFunction();
                tADXFunction.Period = Period;
                tFastLine1.DataSource = tChart1.Series[(int)Graph.TChartMain_Series.TS_OHLC];
                tFastLine1.Function = tADXFunction;

                tFastLine1.Title = "ADX";
                tFastLine1.Marks.Style = MarksStyles.Value;
                tFastLine1.Marks.MultiLine = true;

                tChart1.Series.Add(tFastLine1);



◦ TeeChart version : 4.1.2015.3111
◦ IDE using : Visual Studio 2008
◦ Programming language : C#
◦ OS running : Windows XP 32 Bit

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Scale is not automatically adjusted for Finantial Functions

Post by Christopher » Fri Apr 24, 2015 9:39 am

Hello!

This code runs as expected:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Axes.Bottom.Automatic = true;
      //tChart1.Axes.Left.Automatic = false;

      Steema.TeeChart.Styles.FastLine tFastLine1 = new Steema.TeeChart.Styles.FastLine();
      tFastLine1.VertAxis = VerticalAxis.Left;

      Steema.TeeChart.Functions.ADXFunction tADXFunction = new Steema.TeeChart.Functions.ADXFunction();
      Candle ohlc = new Candle();
      ohlc.FillSampleValues(100);
      tFastLine1.DataSource = ohlc;
      tFastLine1.Function = tADXFunction;

      tFastLine1.Title = "ADX";
      tFastLine1.Marks.Style = MarksStyles.Value;
      tFastLine1.Marks.MultiLine = true;

      tChart1.Series.Add(tFastLine1);
      tChart1.Series.Add(ohlc);
    }
The issue here is when you set:
tChart1.Axes.Left.Automatic = false;

and you do not set the maximum and minimum, e.g.
tChart1.Axes.Left.SetMinMax(0, 1000);
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply