Date/Time formatting in .NET (Devexpress Gantt charts to show time rather than date)
Posted
by calico-cat
on Stack Overflow
See other posts from Stack Overflow
or by calico-cat
Published on 2010-03-30T23:21:08Z
Indexed on
2010/03/30
23:23 UTC
Read the original article
Hit count: 945
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}))
© Stack Overflow or respective owner