简体   繁体   中英

How to force the navigator to show a full year timeline even if the data collectively within it doesn't span an entire year

I am working with the highstock 1.2.4 library and we would like to achieve the following

  • From the navigation buttons I click on "1y" for one year. Which as of today should show, 27th November 2011 to 27th Novermber 2012
  • There are 3 series of points to be plotted, the Y-axis (vertical) represents pressure and the x axis (horizontal) represents time from 27/11/2011 to today.
  • The thing is all 3 sets of points start at different points in October this year but all data runs up until now
  • I get the impression that highstock then tries to scale this data and the navigator is effected as such

So - How do I force the navigator to show my chosen timeline (27/11/2011 - 27/11/20212) with the 3 series starting towards the right hand-side of the graph? We want it to work this way so that the user can see that no data has been captured until recently.

Other graphs would perhaps show data that was captured for a period of time towards the end of last year, giving a true representation of a timeline.

So far the component seems to try and scale data and we don't want it to do that. I have scoured the documentation but am running out of time and guess that someone out there will have done this before.

Assuming you know what the min/max is that your navigator should show or if you want it to always go up to "now", you could do something like:

navigator : {
  xAxis: {
      max : new Date().getTime()
  }
}

in your chart options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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