Getting max and min values from TGantt Chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Friis
Newbie
Newbie
Posts: 26
Joined: Thu Oct 16, 2014 12:00 am

Getting max and min values from TGantt Chart

Post by Friis » Wed Oct 22, 2014 11:19 am

Hi,

I'm adding a TGantt Chart to a TChart using

Code: Select all

Steema.TeeChart.Styles.Gantt Ganttseries = new Steema.TeeChart.Styles.Gantt(tChart1.Chart);
this.tChart1.Series.Add(Ganttseries);
1) How do I find the maximum and minmum StartDate?
2) How do I find the maximum and minmum EndDate?
3) How do I find the maximum and minmum Values? (using the definition, "Ganttseries.Add(startDate,EndDate,y,Color.red)", how to find max and min "y")


I have tried to use the code below to find max y

Code: Select all

Ganttseries.ValuesLists.Max();
But it gives me an exception error

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

Re: Getting max and min values from TGantt Chart

Post by Christopher » Thu Oct 23, 2014 8:45 am

Hello!

Try:

Code: Select all

    private void InitializeChart()
    {
      Steema.TeeChart.Styles.Gantt Ganttseries = new Steema.TeeChart.Styles.Gantt(tChart1.Chart);
      this.tChart1.Series.Add(Ganttseries);

      Ganttseries.FillSampleValues();

      double startMin = Ganttseries.StartValues.Minimum;
      double startMax = Ganttseries.StartValues.Maximum;
      double endMin = Ganttseries.EndValues.Minimum;
      double endMax = Ganttseries.EndValues.Maximum;
      double yMin = Ganttseries.YValues.Minimum;
      double yMax = Ganttseries.YValues.Maximum;

      MessageBox.Show("Maximum Start Date: " + DateTime.FromOADate(startMax).ToLongDateString());
    }
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