I'm working on a project to create a bar graph showing times in a MS Word 2010 document. The main program stores these times in a List<TimeSpan>
I created an example word document using the Insert Chart feature in Word, and made a bar chart with various times (around 1 hour each, formatted as, for example, 01:04:04. (using this code as a template).
I looked in the Open XML SDK 2.0 Productivity Tool and noticed that it was generated in the reflected code as (for the example above):
numericValue9.Text = "4.449074074074074E-2"; //01:04:04
If I want to automatically generate this using my List<TimeSpan>
, how do I convert my TimeSpans to this small numerical value? Is that TimeSpan.TotalDays
?
Also, looking at the Word Document (right clicking the chart and selecting Edit Data), I noticed that "AM" is appended to the end of my TimeSpan. Does excel convert my timespan into a datetime?