Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1621 - Gantt series fails to bind to a List<T> as DataSource
Summary: Gantt series fails to bind to a List<T> as DataSource
Status: RESOLVED FIXED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-06 12:29 EDT by christopher ireland
Modified: 2016-09-23 09:09 EDT (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description christopher ireland 2016-09-06 12:29:11 EDT
Code to reproduce:

  public class GanttData
  {
    public DateTime Start { get; set; }
    public DateTime End { get; set; }
    public double Y { get; set; }
    public string Label { get; set; }
    public Color Color { get; set; }
  }

    private void InitializeChart()
    {
      List<GanttData> lstData = new List<GanttData>();

      GanttData data1;
      DateTime today = DateTime.Today;
      DateTime tmp;

      data1 = new GanttData();
      data1.Color = Color.Red;
      data1.Start = today;
      tmp = today.AddDays(3);
      data1.End = tmp;
      data1.Label = "Un";
      data1.Y = 1;
      lstData.Add(data1);

      data1 = new GanttData();
      data1.Color = Color.Green;
      tmp = today.AddDays(1);
      data1.Start = tmp;
      tmp = tmp.AddDays(1);
      data1.End = tmp;
      data1.Label = "Deux";
      data1.Y = 2;
      lstData.Add(data1);

      tChart1.Aspect.View3D = false;
      tChart1.Header.Text = "Gantt MultipleNextTasks";
      tChart1.Legend.Visible = false;

      Gantt gantt = new Gantt(tChart1.Chart);
      gantt.ConnectingPen.Visible = false;
      gantt.LabelMember = "Label";
      gantt.ColorMember = "Color";
      gantt.StartValues.DataMember = "Start";
      gantt.EndValues.DataMember = "End";
      gantt.YValues.DataMember = "Y";
      gantt.DataSource = lstData;
    }