kumaresan
kumaresan

Reputation: 83

HIghstock Timeseries data date format

I want to create a timeseries chart in Highstock. the data that i receive from the web service is of the following format. For date: "2015/06/28" For week: "week 28 2015" For month: "Jun 2015" For year: "2015"

How should I convert the data in the series?

Currently I am processing the data in this way:

var date = "2015/07/28";
text = date.split('/');
date = new Date(text[0], parseInt(text[1], 10) - 1, text[2]);
newdate = date.getTime();

I am pushing the newdate in the series.

But due to this my chart is shrinked. There is lot of space left in the left and right of the chart.

shrinked chart

Upvotes: 0

Views: 807

Answers (1)

Sebastian Bochan
Sebastian Bochan

Reputation: 37588

You can edit that by dateTimeLabelFormats

dateTimeLabelFormats: {
    millisecond: '%H:%M:%S.%L',
    second: '%H:%M:%S',
    minute: '%H:%M',
    hour: '%H:%M',
    day: '%e. %b',
    week: '%e. %b',
    month: '%b \'%y',
    year: '%Y'
}

Upvotes: 1

Related Questions