filter chart

24 views
Skip to first unread message

rahul varma

unread,
Apr 26, 2016, 9:55:31 AM4/26/16
to d3-js
hi guys,
     i have created a multi line chart with date and no of hits. And now i want to filter data with in two dates by using two dropdown menus and when i submit two dates i should get an output of that two dates.how can i do it






Drew Winget

unread,
Apr 26, 2016, 6:54:30 PM4/26/16
to d3...@googlegroups.com
Try something like this: https://bl.ocks.org/mbostock/1667367

It uses an area rather than a bar chart, but the principle should be the same. Whenever you need to update the chart, simply run it again. Besides the DOM (which it could be argued plays a data store roll in d3), it should be a pure function, so you can run it as many times as you want. Can you post a fiddle of your code so we can help out?

On 26 April 2016 at 06:55, rahul varma <grvr...@gmail.com> wrote:
hi guys,
     i have created a multi line chart with date and no of hits. And now i want to filter data with in two dates by using two dropdown menus and when i submit two dates i should get an output of that two dates.how can i do it






--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Drew Winget

unread,
Apr 26, 2016, 6:57:45 PM4/26/16
to d3...@googlegroups.com
Here's another great example showing how to combine an ordinal scale with a time scale (which is linear by default). It's easy to overlook that you can put multiple scales in the same space to accomplish more complex effects. A good example of that principle on its own is available here.
Reply all
Reply to author
Forward
0 new messages