簡體   English   中英

如何在Highstock步驟圖中僅設置xAxis的時間

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

是否可以將Highstock圖形的xAxis設置為僅顯示時間?

這里顯示日期和時間,我只需要顯示時間:

高庫存圖形圖像

提前致謝。

$(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