Here is a simple way to change a C# datetime to a javascript Datetime.UTC value that can be used in the highcharts pointstart field.
This will return a value that can be used directly in javascript
highcharts pointstart only used Date.UTC values if you are timestamp for the x-axis
In C#
private double DateUTCDate(DateTime date)
{
return date.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds
}
This will return a value that can be used directly in javascript
series: {
pointStart: dataFromCsharp,
pointInterval: 3600 * 1000 // one day
}
highcharts pointstart only used Date.UTC values if you are timestamp for the x-axis
Only programmers can relate.
ReplyDelete