Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Format a datapoints value
posted

Hi, the value of my datapoints are ticks. i would like to convert them to DateTime format for showing them in the chart. Can i apply a IValueConverter or does anybody know another solution? i am using a stacked bar chart.

 

Thanks a lot.

k.

 

Parents
  • 7305
    posted

    Rainer,

    You can use IValueConverter, and one of the overloads on DateTime is passing Ticks as long integer. Here is an example in IValueConverter:

    long ticks = System.Convert.ToInt64(parameter);  // parameter is a tick value (633026088592552384)
    DateTime temp = new DateTime(ticks); 
    return System.Convert.ToDateTime(temp);

    Let me know if you have any question.

    Sam

Reply Children