Programatically updating selection range

Skip to first unread message


Oct 9, 2013, 3:23:34 PM10/9/13
Hello all,
I have a semi working graph based off the time series example working.

What I'm wondering is, how does one programatically set the range in the summary window?  I'm passing in a default selection min and max, which works great.  However,other parts of the page the graph is on have a date range and I essentially want the graph to update its selection based on that (the x-axis is the date in this case).

Thanks a lot!

Tom Hampshire

Jul 14, 2014, 1:05:59 PM7/14/14
I realise this is a very late reply, but I have just solved this problem. If you take whichever object you have assigned to be your leader (summary in this case), you can define a selection based on date.
In my project I am creating an object (I have a custom template called CustomData, but should work the same for timeSeries)

var t = new envision.templates.CustomData(options)

one of the object variables is summary, set be be the leader element. You can make a change to the selection by calling:



area = {
            x1: startTimeMillis,
            x2: endTimeMillis,
            y1: 0,
            y2: 0,
            xfirst: startTimeMillis,
            xsecond: endTimeMillis,
            yfirst: 0,
            ysecond: 0

and startTimeMillis and endTimeMillis are the time in milliseconds since epoch ( the time you get from calling new Date().getTime() ).

Hope this helps

Valentine Bondar

Nov 22, 2014, 5:37:21 PM11/22/14
Thank you for the reply, Tom. 

I am wondering if there is a way to return the selected range so it could be used elsewhere in the program. As in, if the user selects a range on the summary, as soon as she lets go it passes the range to another function.

Will appreciate your time,

Valentine Bondar

Nov 22, 2014, 7:36:24 PM11/22/14
Nvm figured it out. Posted solution on one of the topics :)
Reply all
Reply to author
0 new messages