Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在xAxis中获取带有日期的类别?_Javascript_Jquery_Datetime_Highcharts - Fatal编程技术网

Javascript 如何在xAxis中获取带有日期的类别?

Javascript 如何在xAxis中获取带有日期的类别?,javascript,jquery,datetime,highcharts,Javascript,Jquery,Datetime,Highcharts,我终于得到了我的步骤图,显示了一些结果,但现在我想根据我的需要来设计它 我的代码如下: $(function () { $('#urvalResultIntervalDevelopmentGraf').highcharts('StockChart',{ title: { text: 'Chart' }, rangeSelector : { enabled: false },

我终于得到了我的步骤图,显示了一些结果,但现在我想根据我的需要来设计它

我的代码如下:

$(function () {
    $('#urvalResultIntervalDevelopmentGraf').highcharts('StockChart',{
        title: {
            text: 'Chart'
        },
        rangeSelector : {
            enabled: false
        },
        navigator: {
            enabled: false
        },
        scrollbar: {
            enabled: false
        },
        xAxis: {
            type: 'datetime',
            categories: ['2012-08-10', '2012-09-17', '2013-09-26', '2014-07-01', '2014-09-01', '2014-09-23'],
            gridLineWidth:0
        },
        yAxis: {
            title: {
                text: 'Loss'
            },
            opposite: false,
            gridLineWidth:0
        },
        tooltip: {
            valueSuffix: ':-'
        },
        series: [
            {name:'Gustafsson',step:true,data:[[1344549600,-119],[1347832800,-99],[1380146400,-48],[1404165600,-3],[1409522400,-74],[1411423200,-25]]},
        ],
    });
});
如何在xAxis上显示我的类别? 我猜它不能匹配我的日期(yyyy-mm-dd)和数据中的日期(时间戳),但我不知道如何处理它

我的JSFIDLE在这里:

您不能,例如:您可以使用类别或日期时间xAxis。如果您想要特定的格式,那么只需使用