Usually, when a chart is viewed, the current date is highlighted with a super imposed date line in a different color so as to highlight the current date in relevance to the date range. I need to have a bolded or colored date line which indicates the current date in the chart. I cannot find anything on this. Could you please advise?
Hello,
Thank you for contacting us.
I’m not certain what date line are you mean. Could you please send me an isolated sample and a screen shot of the line, so I can provide you a better support.
I will be waiting for your answer.
Best Regards, Marina Stoyanova, Software Developer, Infragistics, Inc.
I have attached a few files. Thanks.
Sorry I can only upload one file at a time.
That worked perfectly! Thank you very much!
Hello nbizub,
Thank you for posting in our community and for the attachments!I believe this functionality is still not implemented out of the box for the Infragistics ASP.NET Gantt chart, and yet it could be achieved using a custom handling of the FillSceneGraph event. Here is a code snippet:
void chart_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e){ IAdvanceAxis xAxis = (IAdvanceAxis)e.Grid["X"]; IAdvanceAxis yAxis = (IAdvanceAxis)e.Grid["Y"]; int x = Convert.ToInt32(xAxis.Map(DateTime.Now)); int y1 = Convert.ToInt32(yAxis.MapMinimum); int y2 = Convert.ToInt32(yAxis.MapMaximum);
Line l = new Line(); l.p1 = new Point(x, y1); l.p2 = new Point(x, y2); l.PE.Fill = Color.Red; l.PE.StrokeWidth = 3; e.SceneGraph.Add(l);}
Please let me know how this approach works for you!