Page 1 of 1

Getting max and min values from TGantt Chart

Posted: Wed Oct 22, 2014 11:19 am
by 15670445
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

Re: Getting max and min values from TGantt Chart

Posted: Thu Oct 23, 2014 8:45 am
by Christopher
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());
    }