# Picking a date for display on chart

**URL:** <https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095>\
**Category:** Dashboard\
**Created:** [10 August 2024 18:47 UTC](https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095 "2024-08-10T18:47:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xfear1](https://avatars.discourse-cdn.com/v4/letter/x/4da419/32.png) [@xfear1](https://discourse.nodered.org/u/xfear1)\
**Post date:** [10 August 2024 18:47 UTC](https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095/1 "2024-08-10T18:47:53Z")

</div>

Hello,  
I'm trying to change the date to view the data collect in other days on my chart, I saw there's this  
node called date picker, but I don't know to make it interact with the chart node.  
Can anyone give me an idea to make it work?

 ![imagem_2024-08-10_154941274](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b064d49af178b1adc8c2f14feebb12011f4576c.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 August 2024 07:06 UTC](https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095/2 "2024-08-11T07:06:49Z")

</div>

Typically, the date selected is used in a query to the data source then the newly queried data set is sent to the chart.

For anyone to assist you will need to provide more info.

- Where is the data stored? in a database? file? memory? other?
- Explain and show us how you currently populate the chart?

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [11 August 2024 08:12 UTC](https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095/3 "2024-08-11T08:12:05Z")

</div>

![datepicker](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/1331d4c6eea28c52d6bc3616a7e5ea1b3f82f866.gif)

as @Steve-Mcl suggests, i store the data in a mysql database and use the picked date in a mysql query where clause to get the data i want.

---

<div class="post-metadata">

**Author:** ![xfear1](https://avatars.discourse-cdn.com/v4/letter/x/4da419/32.png) [@xfear1](https://discourse.nodered.org/u/xfear1)\
**Post date:** [14 August 2024 11:43 UTC](https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095/4 "2024-08-14T11:43:58Z")

</div>

I save my data in a json file, I don't know how to interact the date picking with the chart to change the date and the data from that day.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/beb9f7a6765ba1c0ba7ee18cbd96c18e36f0b685.png)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 August 2024 12:08 UTC](https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095/5 "2024-08-14T12:08:25Z")

</div>

Save your chosen date in a flow context variable.  
Use a switch node to compare each line from the file with the variable.  
You may need a little jiggery-pokery to get the two dates in the same format.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 September 2024 12:09 UTC](https://discourse.nodered.org/t/picking-a-date-for-display-on-chart/90095/6 "2024-09-13T12:09:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
