# Create a chart from an array of object taken from a libreoffice calc file

**URL:** https://discourse.nodered.org/t/create-a-chart-from-an-array-of-object-taken-from-a-libreoffice-calc-file/60187
**Category:** General
**Created:** [22 March 2022 10:43 UTC](https://discourse.nodered.org/t/create-a-chart-from-an-array-of-object-taken-from-a-libreoffice-calc-file/60187 "2022-03-22T10:43:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ricca\_Porcia](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ricca\_Porcia](https://discourse.nodered.org/u/Ricca_Porcia)
#### Post date: [22 March 2022 10:43 UTC](https://discourse.nodered.org/t/create-a-chart-from-an-array-of-object-taken-from-a-libreoffice-calc-file/60187/1 "2022-03-22T10:43:06Z")

</div>

good morning,  
I state that I am new to this platform and I am not at all expert in Javascript. I need to do a project in which I have to take data from a sheet of libreoffice calc and create a chart with those. I found a program that creates me a graph with variable axes but I can't insert the values ​​contained in the array of objects as graph values. Here I am attaching a photo of my program.

 ![Program](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a31e5a30108045eb3b1bc91b79da25fe0e225bed.png)

this is the program for the chart:

```nohighlight
var temp=[];
var time_float = 0;
var temp_float=0;

temp[0] = 24.5
temp[1] = 26
temp[2] = 28
temp[3] = 30

time[0] = 1552215913000
time[1] = 1552218111000 
time[2] = 1552225320000 
time[3] = 1552232527000

var i=0;
var dataarray = [[]];

for (i=0; i< 4; i++) {
time_float = Number(time[i]);
temp_float = Number(temp[i]);
dataarray[0][i] = {"x":time_float,"y":temp_float};

}

var chart = [{
    "series":["Temperature ="],
    "data":dataarray,
    "labels":[""]
}];

msg.payload = chart;

return msg;

```

and this is how the data of libreoffice calc are taken

![Screenshot (7)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/148e59464bc5e199dce0164089b501d32a545679.png)

Thanks in advance.

---

<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: [22 March 2022 11:53 UTC](https://discourse.nodered.org/t/create-a-chart-from-an-array-of-object-taken-from-a-libreoffice-calc-file/60187/2 "2022-03-22T11:53:56Z")

</div>

> [@Ricca\_Porcia](#):
>
> this is the program for the chart:

You need to look at the built in help for the chart node.

It explains (and gives an example) of the required data format

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/674de6bff95d952078e584749d2eb08e62484905.png)

---

<div class="post-metadata">

### Author: ![Ricca\_Porcia](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ricca\_Porcia](https://discourse.nodered.org/u/Ricca_Porcia)
#### Post date: [25 March 2022 07:26 UTC](https://discourse.nodered.org/t/create-a-chart-from-an-array-of-object-taken-from-a-libreoffice-calc-file/60187/3 "2022-03-25T07:26:16Z")

</div>

there is one problem. When i click in the site it says "page not found".  
I'm in italy so i need a vpn to open it?  
Thanks in advance

---

<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: [24 May 2022 07:27 UTC](https://discourse.nodered.org/t/create-a-chart-from-an-array-of-object-taken-from-a-libreoffice-calc-file/60187/4 "2022-05-24T07:27:03Z")

</div>

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