Date/Time formatting in .NET (Devexpress Gantt charts to show time rather than date)
- by calico-cat
I have some data about a day's events that I'm trying to visualise as a Gantt chart using Devexpress XtraCharts. Devexpress's example here shows the chart being populated by date. However, I'd like it to be populated by time to compare the events throughout one day.
My X-axis is displaying correctly - done like so:
ganttDiagram.AxisY.DateTimeMeasureUnit = DateTimeMeasurementUnit.Minute
I have data with the correct time, however, the label on each series is showing the date (which are all the same, because it's all the same day!) Thus, instead of being a bar, all of them are just single points, with the label showing 31/03/2010 - 31/03/2010.
Each series is created with the code below:
s.Points.Add(New SeriesPoint("Machine", New DateTime() {ev.StartTime, ev.EndTime}))