I have an app in which I'm using the included ASP.NET Chart controls. In one of my charts, I need to show a Bar chart with durations. The durations are stored as TimeSpan objects as shown here:
List<TimeSpan> durations = GetDurations(); // Will be between 15 minutes and 6 hours
List<string> labels = GetLabels();
...
chart.Series["Default"].Points.DataBindXY(xValues, durations);
When I execute this, an Exception is thrown that says:
Series data points do not support values of type System.TimeSpan only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.
The exception is very clear what the problem is. However, how do I show my durations in a bar chart then?
Thank you!