简体   繁体   English

如何在Highstock步骤图中仅设置xAxis的时间

[英]How to set xAxis only with time in Highstock step graph

Is there any possibility to set the xAxis of the Highstock graph to display only the time? 是否可以将Highstock图形的xAxis设置为仅显示时间?

Here it shows both date and time and I need to display only time: 这里显示日期和时间,我只需要显示时间:

高库存图形图像

Thanks in advance. 提前致谢。

$(function () {

    // Create the chart
    Highcharts.stockChart('container1', {
        chart: {
        width: 500,
        height: 300
        },
        title: {
            text: 'AAPL Stock Price'
        },
         xAxis: {
        tickInterval: 1
    },
        rangeSelector: {
            selected: 4,
            inputEnabled: false,
            buttonTheme: {
                visibility: 'hidden'
            },
            labelStyle: {
                visibility: 'hidden'
            }
        },
        navigator: {
            enabled: false
        },
        scrollbar: {
            enabled: false
        },
        series: [{
            name: 'AAPL Stock Price',
            data: [45,90,90,45,50,90,39,50,90,39],
            step: true,
            tooltip: {
                valueDecimals: 2
            }
        }]
    });

}); });

$(function () {
        Highcharts.stockChart('container', {
            chart: {
            width: 500,
            height: 300
            },
            title: {
                text: 'AAPL Stock Price'
            },
             xAxis: {
                type: 'datetime',  
                tickInterval : 1,
                dateTimeLabelFormats : {
                    day: '%M min'
                }
            },
            rangeSelector: {
                selected: 0,
                inputEnabled: false,
                buttonTheme: {
                    visibility: 'hidden'
                },
                labelStyle: {
                    visibility: 'hidden'
                }
            },
            navigator: {
                enabled: false
            },
            scrollbar: {
                enabled: false
            },
            series: [{
                name: 'AAPL Stock Price',
                data: [45,90,90,45,50,90,39,50,90,39],
                pointStart: Date.UTC(2010, 0, 1),
                pointInterval: 3600 * 1000 , 
                step: true,
                tooltip: {
                    valueDecimals: 2
                }
            }]
        });
});

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

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