Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.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 Highcharts/stock xAxis仅显示年份_Javascript_Svg_Highcharts - Fatal编程技术网

Javascript Highcharts/stock xAxis仅显示年份

Javascript Highcharts/stock xAxis仅显示年份,javascript,svg,highcharts,Javascript,Svg,Highcharts,我正在用高价股制作一些图表 我的数据看起来像: [1133308800, 1.95492806759836], [1135987200, 2.01739233585526], [1138665600, 2.0725059567737], [1141084800, 1.89533596472326], 以及我的xAxis设置: xAxis: { labels: { style: {

我正在用高价股制作一些图表

我的数据看起来像:

[1133308800, 1.95492806759836],
[1135987200, 2.01739233585526],
[1138665600, 2.0725059567737],
[1141084800, 1.89533596472326],
以及我的xAxis设置:

            xAxis: {

                labels: {
                    style: {
                        textTransform: 'uppercase',
                        color: '#a7b9c7',
                        fontFamily: 'Helvetica Neue, Helvetica',
                        fontSize: '11px'
                    }
                },
                lineWidth: 0,
                minorGridLineWidth: 0,
                lineColor: 'transparent',
                minorTickLength: 0,
                tickLength: 0,
                plotLines: [{
                    color: '#3b3c40',
                    dashStyle: 'dot',
                    value: .5,
                    width: 1
                }]
            },
问题是xAxis上的标签类似于14。Jan等,我想从我的数据中得到一年

    $.getJSON(name + '.json', function(data) {

        seriesOptions[i] = {
            name: name,
            data: data,
            color: colors[i]
        };

        seriesCounter += 1;

        if (seriesCounter === names.length) {
            createChart();
        }
    });
有人能告诉我如何在xAxis上只显示年份吗


您可以通过以下方式配置日期时间标签

{
    millisecond: '%H:%M:%S.%L',
    second: '%H:%M:%S',
    minute: '%H:%M',
    hour: '%H:%M',
    day: '%e. %b',
    week: '%e. %b',
    month: '%b \'%y',
    year: '%Y'
}