简体   繁体   中英

Highstock Highcharts date time data on Xaxis

I'm trying to use a Js timstamp like specified in the doc, to use it on Xaxis. I tried but can't figure it out. The goal is to make work the date data to use a datepicker.

I tried on Xaxis categories: with my timestamp array but its not working.

I tried to format other timestamp not working too.

I tried to remove categories to put type: 'datetime' but after I didn't get where i have to put the date data, i tried in series but not working..

here is my work http://jsfiddle.net/tomichek/uL4ve2n4/ enter code here thanks for your help.

Simply modify your data format, from:

var data = [y_1, y_2, y_3, ... , y_N];

To:

var data = [ [x_1, y_1], [x_2, y_2], [x_3, y_3], ... , [x_N, y_N] ];

For example, using JS with your variables:

$.each([tab_obj_idle, tab_gap_idle, tab_w2_idle, tab_w4_idle, tab_pobj_idle, tab_pw_idle], function(i, data) {
    $.each(data, function(j, point) {
        data[j] = [tab_week_idle[j], point];
    });
});

Demo: http://jsfiddle.net/uL4ve2n4/1/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM