简体   繁体   English

未能使Highstock图表上的xAxis出现在之前

[英]fail to make xAxis on Highstock chart to go before

I have a jsFiddle here to show my problem, 这里有一个jsFiddle来显示我的问题,

I want my chart to start on xAxis two month before than it has data on it, 我希望我的图表从xAxis上开始,比它上有数据的日期早两个月,

how can I show from two month before? 我要如何从两个月前开始表演?

   'xAxis': {
        'min': Date.UTC(2013, 4, 24, 16, 44, 10),
        'startOnTick' : false,
        'startOfWeek': 6,
        'dateTimeLabelFormats': {
            'week': '%a,<br/>%e. %b'
        }
    },

start the data from the date you want to show in chart. 从要在图表中显示的日期开始数据。

if there is no data give the y value as null 如果没有数据,则将y值设置为null

in your case you want the min for xAxis to be Date.UTC(2012, 1, 24, 16, 44, 10) 在您的情况下,您希望xAxis的最小值为Date.UTC(2012,1,24,16,44,10)

so start data from 所以从开始数据

data: [ [Date.UTC(2012, 1, 24, 16, 44, 10), null], [Date.UTC(2013, 6, 24, 16, 44, 10), 336000.], [Date.UTC(2013, 6, 27, 13, 57, 36), 393500.] ]

this will make the xAxis plot from the day you want. 这将从所需的日期开始绘制xAxis图。

I've updated your fiddle here 我在这里更新了你的小提琴

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

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