# Show operating conditions in a pie chart

**URL:** https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235
**Category:** General
**Created:** [4 February 2020 06:47 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235 "2020-02-04T06:47:21Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Maigo](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Maigo](https://discourse.nodered.org/u/Maigo)
#### Post date: [4 February 2020 06:47 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/1 "2020-02-04T06:47:21Z")

</div>

Hello,  
I want to show the conditions (like machine on, machine off, fault, prepare) of our machine in a pie chart.  
How can I realize this?  
The signals of every condition is boolean (0 or 1).

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [4 February 2020 06:54 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/2 "2020-02-04T06:54:04Z")

</div>

You need to explain what information you want to convey to users in the chart. Is it the relative % of the time spent in each condition? Or the number of reports of each condition? Or something else?

---

<div class="post-metadata">

### Author: ![Maigo](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Maigo](https://discourse.nodered.org/u/Maigo)
#### Post date: [4 February 2020 07:12 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/3 "2020-02-04T07:12:26Z")

</div>

I want to show how long every condition is true in the time of one day.  
But at first I have to find out a timer wich counts the time for the duration if the bit of one conditon is true.  
Do you have an idea for such a timer?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 February 2020 10:56 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/4 "2020-02-04T10:56:05Z")

</div>

Do you want one pie chart for all the devices or a seperate chart for each device?

You might want to look at this [flow](https://flows.nodered.org/flow/962f26944542a8c1fd929b330f2c0bd2) (from the Flow Library) for an idea of how you might go about it.

---

<div class="post-metadata">

### Author: ![Maigo](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Maigo](https://discourse.nodered.org/u/Maigo)
#### Post date: [4 February 2020 10:58 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/5 "2020-02-04T10:58:57Z")

</div>

I want all conditions in one pie chart

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [4 February 2020 11:08 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/6 "2020-02-04T11:08:01Z")

</div>

How will someone looking at the chart know what anyone slice means? Will it show the last 24 hours or the time from the start of the day?

So you will need to calculate the event time for the device then add up the total time for the device and figure the percentage the event has of the total time. Since the total percentage should be 100%, you can then use the device percentages in the graph to show how long each event took place.

Although - to me - it seems like the graph will just tell you which device has been on the longest, not how long it has been on.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [4 February 2020 12:53 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/7 "2020-02-04T12:53:43Z")

</div>

Are you sure that something like this may not be a better choice ?

> [@\[Announce\] node-red-contrib-ui-state-trail \[Features\]](https://discourse.nodered.org/t/announce-node-red-contrib-ui-state-trail-features/20539/23):
>
> Meanwhile the state-trail got some updates v0.1.6 Legend (with option to toggle between state names and aggregated time per state) Improved configuration page (to indicate configuration errors more clearly) [statetrail]

---

<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: [4 April 2020 12:53 UTC](https://discourse.nodered.org/t/show-operating-conditions-in-a-pie-chart/21235/8 "2020-04-04T12:53:47Z")

</div>

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