简体   繁体   English

每天从同一时间开始

[英]start at the same hour every day

Hello in xAxis I need to function getTime () (for example) start every day at 0:00 am, or also at 06:00 am, or also at 12:00 pm or also at 18:00 pm 您好在xAxis中,我需要使用getTime()函数(例如),每天从0:00 am,或者从06:00 am,或者从12:00 pm,或者从18:00 pm开始

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 Always starts at 00:00 hours, 6:00 hours to 12:00 hours and 18:00 hours +6总是在00:00、6:00至12:00和18:00开始

So I need to know the function getTime () starts at a specific time every day for four different graphics 所以我需要知道函数getTime()在每天的特定时间针对四种不同的图形启动

Thanks 谢谢

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

Need to setup pointStart and pointInterval in that way: 需要以这种方式设置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
    }]
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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