时间没有在高图中显示

时间:2018-07-10 14:40:56

标签: highcharts jstockchart

对于高图表,我有此配置

<div id="chart-1" style="width: 100%;height:350px;"></div>
<script>
Highcharts.stockChart('chart-1', {
colors: ['#4bad29','#ffc123', '#2196f3', '#d48265', '#91c7ae','#749f83',  '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'],
chart: {
    zoomType: 'xy'
},
title: {
    text: ''
},
rangeSelector: {
    inputEnabled: false,
    selected: 0,
    buttons: [{
        type: 'month',
        count: 1,
        text: '30Days'
    },{
        type: 'month',
        count: 2,
        text: '2 Months'
    },{
        type: 'month',
        count: 3,
        text: '3 Months'
    }],
    buttonTheme: {
        width: 50
    }
},
navigator: {
    enabled: true
},
xAxis: {
    type: 'datetime',
    dateTimeLabelFormats: {
        second: '%Y-%m-%d<br/>%H:%i:%s',
        minute: '%Y-%m-%d<br/>%H:%i',
        hour: '%Y-%m-%d<br/>%H:%i',
        day: '%Y<br/>%m-%d',
        week: '%Y<br/>%m-%d',
        month: '%Y-%m',
        year: '%Y'
    }
},
yAxis: {
    title: {
        text: false
    },
    min: 0
},
credits: {
    enabled: false
},
tooltip: {
    useHTML: true,
    formatter: function() {
    var htmlstring = '';
        var allpoints=this.points;
        if(allpoints){
            $.each(allpoints, function( index, value ) {
                htmlstring += value.series.name+': '+value.y+'<br />';
            });
        }
        return htmlstring;
    }
},
plotOptions: {
    column: {
        dataLabels: {
            enabled: true
        }
    }
},

series: [{
    name: 'Driver',
    type: 'column',
    data: [
        <?php foreach($count_time as $count_time_){ ?>
            [Date.UTC(<?php echo $month = date("Y",strtotime($count_time_['time_series'])); ?>,  <?php echo $month = date("m",strtotime($count_time_['time_series'])) - 1; ?>, <?php echo $month = date("d",strtotime($count_time_['time_series'])); ?>,<?php echo $month = date("H",strtotime($count_time_['time_series'])); ?>,<?php echo $month = date("i",strtotime($count_time_['time_series'])); ?>,<?php echo $month = date("s",strtotime($count_time_['time_series'])); ?>), <?php if($count_time_['drivers']!=''){ echo $count_time_['drivers']; }else{ echo "0"; } ?>],
                <?php 
            } ?>
        ],
        maxPointWidth: 50
    }]
});
</script>

我正在尝试显示带时间的日期。日期以给定的格式显示,但时间未显示。 我有什么想念的时间吗?

这就是我的数据的样子 enter image description here

我想以12小时的间隔显示条形图,但是它正确显示了数据,但是我想根据时间显示它,由于我认为时间不起作用。

谢谢

0 个答案:

没有答案