Page 1 of 1

How to display last point.

Posted: Tue Aug 05, 2008 2:37 pm
by 14049416
I am a candle chart and I am loading 1000 candles in to it. I set the MaxPointsPerPage to 50. When the chart is displayed the first time I want to show the user a full 50 candles with the last candle visible. In other words, I want to go to the end of of candles which is the most current date.

What is the best way of doing this? I tried using Scroll but I have to jump through some hoops to get there and it always sets the tChart1.Axes.Bottom.Automatic property to false. which may be normal behavior.

Thanks,
Kevin

Re: How to display last point.

Posted: Wed Aug 06, 2008 5:39 am
by Chris
Hello Kevin,
WD_Gordon wrote:I am a candle chart and I am loading 1000 candles in to it. I set the MaxPointsPerPage to 50. When the chart is displayed the first time I want to show the user a full 50 candles with the last candle visible. In other words, I want to go to the end of of candles which is the most current date.

What is the best way of doing this? I tried using Scroll but I have to jump through some hoops to get there and it always sets the tChart1.Axes.Bottom.Automatic property to false. which may be normal behavior.
Probably the best way is to do something similar to the following:

Code: Select all

    private Steema.TeeChart.Styles.Candle series;

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      tChart1.Series.Add(series = new Candle());
      series.FillSampleValues(1000);

      tChart1.Page.MaxPointsPerPage = 50;
      tChart1.Page.Current = tChart1.Page.Count - 1;
    }