Search code examples
c#wpflivecharts

C# WPF Livecharts Formatter


I have hit somewhat of a roadblock with livecharts and formatting my x axis. I have to accommodate for a few different options. I am importing data that can range from 10 seconds to over 2 hours worth of data points. when using

    Formatter = value => new DateTime((long)(value * 
    TimeSpan.FromMinutes(1).Ticks)).ToString("mm:ss");

I get restarting values at every hour

but when using

   Formatter = value => new DateTime((long)(value * TimeSpan.FromMinutes(1).Ticks)).ToString("hh:mm:ss");

I get values starting at 12

How do I get better formatted times starting at 0:00:00?


Solution

  • Just add another TimeSpan.FromHours(12) - basically moving the time forward 12 hours.