# Pie Chart white colors (Why?)

**URL:** <https://discourse.nodered.org/t/pie-chart-white-colors-why/41642>\
**Category:** Dashboard\
**Created:** [25 February 2021 20:28 UTC](https://discourse.nodered.org/t/pie-chart-white-colors-why/41642 "2021-02-25T20:28:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pautorras](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pautorras](https://discourse.nodered.org/u/pautorras)\
**Post date:** [25 February 2021 20:28 UTC](https://discourse.nodered.org/t/pie-chart-white-colors-why/41642/1 "2021-02-25T20:28:20Z")

</div>

Hi all, and thank you in advance. I've been searching before, but I don't find any entry with white pie chart problem.  
I want to output in dashboard 3 values with two charts, bar chart and pie chart. The output is the same. I don't understand why with the bar chart the colors are shown perfect and with the pie chart is all white.

I attach the NR code:

```auto
[{"id":"6d3f8d5c.819c04","type":"inject","z":"9e72b951.02dc78","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":400,"wires":[["f9b88668.7bfa78"]]},{"id":"f9b88668.7bfa78","type":"function","z":"9e72b951.02dc78","name":"","func":"var newMsg = {\"topic\": \"SELECT * FROM ContKwh ORDER BY Ind DESC LIMIT 2\"}\nreturn newMsg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":400,"wires":[["80ed1d44.ef78f"]]},{"id":"80ed1d44.ef78f","type":"mysql","z":"9e72b951.02dc78","mydb":"dd185369.7a13b","name":"","x":520,"y":400,"wires":[["e4d9597a.4254e8"]]},{"id":"e4d9597a.4254e8","type":"function","z":"9e72b951.02dc78","name":"","func":"var KwCasaUltimDia= msg.payload[0].KwhX1-msg.payload[1].KwhX1;\nvar KwFVUltimDia= msg.payload[0].KwhFV1-msg.payload[1].KwhFV1;\nvar KWFecsaUltimDia= msg.payload[0].KwhX1-msg.payload[0].KwhFV1;\nvar m={},label,data;\nm.series=[];\nm.labels=['FV','Companyia','Consum'];\nm.data=[KwFVUltimDia,KWFecsaUltimDia,KwCasaUltimDia];\n\nreturn {payload:[m]};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":400,"wires":[["a04080da.3c40d","b68dd83c.2f1da8"]]},{"id":"a04080da.3c40d","type":"ui_chart","z":"9e72b951.02dc78","name":"","group":"aa43db30.ce1298","order":8,"width":6,"height":5,"label":"Kw Dia Consum","chartType":"bar","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#47ee44","#f8f00d","#0fe3ff","#2da92d","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":870,"y":400,"wires":[[]]},{"id":"b68dd83c.2f1da8","type":"ui_chart","z":"9e72b951.02dc78","name":"","group":"aa43db30.ce1298","order":9,"width":6,"height":5,"label":"Kw Dia Consum","chartType":"pie","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":"70","useOneColor":true,"useUTC":false,"colors":["#47ee44","#f8f00d","#0fe3ff","#2da92d","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":870,"y":440,"wires":[[]]},{"id":"dd185369.7a13b","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"fvdb","tz":"","charset":""},{"id":"aa43db30.ce1298","type":"ui_group","name":"Gràfics","tab":"7605e0c6.2cdf9","order":1,"disp":true,"width":12,"collapse":false},{"id":"7605e0c6.2cdf9","type":"ui_tab","name":"Anàlisi Gràfic","icon":"dashboard","order":37,"disabled":false,"hidden":false}]

```

![Captura de Pantalla 2021-02-25 a les 21.26.32](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/3457747a0dbd9ef5bf5ad9da8b9e25683702e9ad.png)

Best Regards!

Pau

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 February 2021 21:17 UTC](https://discourse.nodered.org/t/pie-chart-white-colors-why/41642/2 "2021-02-25T21:17:49Z")

</div>

Um, to save other people grief, how about you post a flow which doesn't need them to have a file existing?

I am suspicious that it is because the data being received is not valid.

But as I can't test the flow, I can't be sure.

---

<div class="post-metadata">

**Author:** ![pautorras](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pautorras](https://discourse.nodered.org/u/pautorras)\
**Post date:** [3 March 2021 14:35 UTC](https://discourse.nodered.org/t/pie-chart-white-colors-why/41642/3 "2021-03-03T14:35:11Z")

</div>

Thanks @Trying_to_learn , you are right.  
As simple as data structure was not valid.

Sorry for the my topic format.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [3 March 2021 20:33 UTC](https://discourse.nodered.org/t/pie-chart-white-colors-why/41642/4 "2021-03-03T20:33:31Z")

</div>

Hey, that's ok.

Glad it is all sorted.

---

<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:** [2 April 2021 20:34 UTC](https://discourse.nodered.org/t/pie-chart-white-colors-why/41642/5 "2021-04-02T20:34:21Z")

</div>

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