0

こんにちは xAxis で getTime () を機能させる必要があります (たとえば) 毎日午前 0:00、または午前 6:00、または午後 12:00 または午後 18:00 に開始します

xAxis: { categories: ["+6","+9","+12","+15","+18","+21","+24","+27","+30","+33","+36","+39","+42","+45","+48","+51","+54","+57","+60","+63","+66","+69","+72","+75","+78","+81","+84","+87","+90","+93","+96","+99","+102","+105","+108","+111","+114","+117","+120","+123",+"126","+129","+132","+135","+138","+141","+144","+147","+150","+153","+156","+159","+162","+165","+168","+171","+174","+177","+180","+183","+186","+189","+192"],

+6 常に 00:00 時間、6:00 時間から 12:00 時間、および 18:00 時間に開始

したがって、関数 getTime () が 4 つの異なるグラフィックに対して毎日特定の時刻に開始されることを知る必要があります。

ありがとう

4

1 に答える 1

1

例: http://jsfiddle.net/JtMDj/2/

そのように pointStart と pointInterval を設定する必要があります。

var date = new Date();
date.setHours(12);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);


var ts = Math.round(date / 1000);
var tsNoon = ts;

var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container'
    },
    xAxis: {
        type: 'datetime',
        dateTimeLabelFormats: {
            day: '%e of %b'
        }
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
        pointStart: tsNoon * 1000, // highcharts asks for miliseconds
        pointInterval: 24 * 3600 * 1000 // one day
    }]
});
于 2013-07-05T11:06:06.487 に答える