# Context and chart example

**URL:** <https://discourse.nodered.org/t/context-and-chart-example/92737>\
**Category:** General\
**Tags:** node-red-dashboard, context\
**Created:** [28 October 2024 14:31 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737 "2024-10-28T14:31:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gallionjason](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gallionjason/32/81511_2.png) [@gallionjason](https://discourse.nodered.org/u/gallionjason)\
**Post date:** [28 October 2024 14:31 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737/1 "2024-10-28T14:31:46Z")

</div>

Hello, would anyone have an example using Context output to a dashboard chart? I have data going into context successfully, but I'm having trouble getting data from Context and sending it to a chart in dashboard. The data will start and stop, so I may need a trigger that starts and stops with the data. Any examples would be helpful, thank you.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 October 2024 15:01 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737/2 "2024-10-28T15:01:10Z")

</div>

Why don't you just send directly to the chart instead of into context and out again?

---

<div class="post-metadata">

**Author:** ![gallionjason](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gallionjason/32/81511_2.png) [@gallionjason](https://discourse.nodered.org/u/gallionjason)\
**Post date:** [28 October 2024 16:28 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737/3 "2024-10-28T16:28:43Z")

</div>

Hello Colin, thank you for the question. At the moment the data is sent directly to the chart, but there is a lag populating the chart when the user switches between tabs on the dashboard. I was hoping using Context would help smooth it out or add a buffer.

---

<div class="post-metadata">

**Author:** ![gallionjason](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gallionjason/32/81511_2.png) [@gallionjason](https://discourse.nodered.org/u/gallionjason)\
**Post date:** [28 October 2024 16:41 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737/4 "2024-10-28T16:41:17Z")

</div>

Also, I would like to use Context to get averages over time.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 October 2024 17:04 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737/5 "2024-10-28T17:04:32Z")

</div>

> [@gallionjason](#):
>
> At the moment the data is sent directly to the chart, but there is a lag populating the chart when the user switches between tabs on the dashboard.

Which chart node are you using? Charts that are not currently on display should still be populated in the background.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 October 2024 17:05 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737/6 "2024-10-28T17:05:13Z")

</div>

> [@gallionjason](#):
>
> would like to use Context to get averages over time.

You can still send the data to context for averages, as well as sending directly to the chart.

---

<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:** [14 November 2024 14:30 UTC](https://discourse.nodered.org/t/context-and-chart-example/92737/7 "2024-11-14T14:30:51Z")

</div>

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