It is currently Thu Aug 28, 2014 5:08 am Advanced search

set end date to today

Technical support for the Highcharts Stock package

set end date to today

Postby Erwane » Fri Feb 24, 2012 1:29 am

Hi,

I've data in the past and in the futur (events date).
By default, i set a 3 month range but the graph show the last event day and 3 month before.

there is a way to set the start graph or end graph date to today to show the current period ?

Thanks

Highstock JS v1.1.3 (2012-02-03)
Erwane
 
Posts: 4
Joined: Fri Feb 24, 2012 1:22 am

Re: set end date to today

Postby hfrntt » Tue Feb 28, 2012 2:26 pm

I'm not quite sure if I understood what you meant, how about setting min / max? (http://www.highcharts.com/stock/ref/#xAxis--min)
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: set end date to today

Postby Erwane » Tue Feb 28, 2012 8:55 pm

No, it's not min and max.

example :
i've events from 01 jan 2010 to 31 dec 2012
my request count the number of event by day and create the graph.
My graph is set by default to show 3 months.

The problem is, the graph automaticaly show the last 3 months, from 10 oct 2012 to 31 dec 2012.

My question is : how to put the graph from today to today + 3 months.
If i display graph today, i will show the number of events from today to 27 may 2012.

Thanks
Erwane
 
Posts: 4
Joined: Fri Feb 24, 2012 1:22 am

Re: set end date to today

Postby hfrntt » Fri Mar 02, 2012 5:51 pm

So you can do this using min and max (see: http://jsfiddle.net/fQ8QD/)

If you want to do it in a runtime (for example provide a button) you should use axis.setExtremes function, see: http://www.highcharts.com/stock/ref/#axis-object
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: set end date to today

Postby Erwane » Fri Mar 02, 2012 6:23 pm

Ok, thanks for help. I thinked min and max was the start and stop X axis graph.

Thanks
Erwane
 
Posts: 4
Joined: Fri Feb 24, 2012 1:22 am


Return to Highstock Usage

Who is online

Users browsing this forum: No registered users and 1 guest