I have a Gantt chart that I am adding items to via looping through a dataset. Everything is going smoothly except that I need each GanttTimeEntry to have its own specific color assigned to it. I did this in the designer by assigning the color and stroke in the PE properties of each entry. The excerpt below outlines how I am trying to do the same thing but in the code behind. However, the PE properties are not being applied and whenever I load the chart. It appears a random color is being applied to each GanttItem because when I refresh, each item has a new color.
GanttSeries series = new GanttSeries();series.Label = "GanttSeries";GanttItem gi = new GanttItem("GanttItem1");
GanttTimeEntry gte1 = new GanttTimeEntry(Convert.ToDateTime("00:00:00"), Convert.ToDateTime("23:59:59"));gte1.PE.Fill = Color.Red;gte1.PE.Stroke = Color.Red;gte1.PE.StrokeWidth = 1;
gi.Times.Add(gte1);series.Items.Add(gi);
Problem solved, I forgot to establish the ElementType. Issue was fixed using the line below: