views:

406

answers:

1

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 point is created with the code below:

s.Points.Add(New SeriesPoint("ASeries", New DateTime() {event.StartTime, event.EndTime}))

Any suggestions as to how to format the labels as ShortTime rather than Date?

+1  A: 

Figured it out!

When adding a series to the chart, adding this line does the trick:

s.PointOptions.ValueDateTimeOptions.Format = DateTimeFormat.ShortTime

calico-cat