Adapting date range filter to pick one of several discrete dates

40 views
Skip to first unread message

Nick Dunbar

unread,
Jan 23, 2018, 5:25:14 AM1/23/18
to Google Visualization API
Hi, 

I have a chart whose data source can be selected from one of several discrete dates, such as "2015-12-31", "2016-12-31" etc, which are contained in an array.

I need a slider that selects one of these date values, uses it to filter the data, and runs the chart drawing function (the selected values can either be Javascript dates, strings or their index position on the array). The idea is that the values are equally positioned along the slider range. Dragging the button and releasing it detects the nearest one and passes that value to the function for charting. 

I’ve found something like this in HTML: 

<form action="/action_page.php" method="get">
  Date:
  <input type="range" name="dateSelect" min="0" max="10">
  <input type="submit">
</form>

But this doesn’t let you set the values on the range yourself, and it requires a ‘submit’ button which I don’t want. There are few jQuery slider add ins on Github but they look overspecified for my requirements. 

Could this be done instead using the Date Range Filter? Thanks as always…

Nick 

Daniel LaLiberte

unread,
Jan 23, 2018, 8:58:51 AM1/23/18
to Google Visualization API
If the DateRangeFilter could work for the filtering part, you will currently have to draw your own set of dates along the slider.  Handle the control's statechange event to do that each time it is changed.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/a8d61a04-5931-4eaa-a508-61cd00525d13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Nick Dunbar

unread,
Jan 23, 2018, 11:12:28 AM1/23/18
to google-visua...@googlegroups.com
Hi Dan, 

Thanks for the quick response. Would you mind elaborating on that reply, maybe with a quick example? 

All help appreciated. 

Nick 

On Tue, Jan 23, 2018 at 1:58 PM, 'Daniel LaLiberte' via Google Visualization API <google-visua...@googlegroups.com> wrote:
If the DateRangeFilter could work for the filtering part, you will currently have to draw your own set of dates along the slider.  Handle the control's statechange event to do that each time it is changed.
On Tue, Jan 23, 2018 at 5:25 AM, Nick Dunbar <dunba...@gmail.com> wrote:
Hi, 

I have a chart whose data source can be selected from one of several discrete dates, such as "2015-12-31", "2016-12-31" etc, which are contained in an array.

I need a slider that selects one of these date values, uses it to filter the data, and runs the chart drawing function (the selected values can either be Javascript dates, strings or their index position on the array). The idea is that the values are equally positioned along the slider range. Dragging the button and releasing it detects the nearest one and passes that value to the function for charting. 

I’ve found something like this in HTML: 

<form action="/action_page.php" method="get">
  Date:
  <input type="range" name="dateSelect" min="0" max="10">
  <input type="submit">
</form>

But this doesn’t let you set the values on the range yourself, and it requires a ‘submit’ button which I don’t want. There are few jQuery slider add ins on Github but they look overspecified for my requirements. 

Could this be done instead using the Date Range Filter? Thanks as always…

Nick 

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.



--

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/DczrXayF7eg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

Daniel LaLiberte

unread,
Jan 23, 2018, 11:58:07 AM1/23/18
to Google Visualization API
Sorry.. I don't have time to put together an example.  Set up a statechange handler, and you will begin to see what needs to happen.

But maybe I am misunderstanding what you want to accomplish. 

On Tue, Jan 23, 2018 at 11:12 AM, Nick Dunbar <dunba...@gmail.com> wrote:
Hi Dan, 

Thanks for the quick response. Would you mind elaborating on that reply, maybe with a quick example? 

All help appreciated. 

Nick 
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsubscr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages