Data from file to html chart

#1

Hi everybody!
frist sorry about english.
im new in node red. i want to show data in html chart from file.(file = saved data from chart in dashboard).it is log of my device .i dont know what can i do.

0 Likes

#2

Hi there !
I don't think you're problem is node-red related ^^
I think this is what you're searching for
https://stackoverflow.com/questions/101574/how-to-open-an-external-file-from-html

0 Likes

#3

It is not clear to me exactly what you want to do. Can you try and explain again please.

0 Likes

#4

A quick search on this forum for "dashboard table" gives some good examples ...

0 Likes

#5

i want to create html chart in group in node red dashboard but every chart that i saw create with data that in writing function but i want to read data from json file which get from another chart in dashboard.

0 Likes

#6

i want to create html chart in group in node red dashboard but every chart that i saw create with data that in writing function but i want to read data from json file which get from another chart in dashboard.
in a simple word i want to create html chart that show log.

0 Likes

#7

Hi - it's not clear what mean as you say you already have the data in a chart in the dashboard... so why feed it to another chart ? you could just send the data to both ?

0 Likes

#8

Frist thanks for emphasize to my problem.i want to send some data to my chart in dashboard and when show them after that save log from chart with date and then when i need to see log i search in file and show all of them in another in html chart .

0 Likes

#9

[{"id":"2b0df91b.758286","type":"http response","z":"8d3931b1.b63d6","name":"","statusCode":"","headers":{},"x":630,"y":3580,"wires":[]},{"id":"cd613eab.0f406","type":"http in","z":"8d3931b1.b63d6","name":"","url":"/chart1","method":"get","upload":false,"swaggerDoc":"","x":70,"y":3580,"wires":[["a05f609b.db6e2"]]},{"id":"a05f609b.db6e2","type":"file in","z":"8d3931b1.b63d6","name":"json file","filename":"C:\Users\user\AppData\Roaming\npm\node_modules\node-red\public\1.json","format":"utf8","chunk":false,"sendError":false,"x":280,"y":3580,"wires":[["84c4d21f.289"]]},{"id":"84c4d21f.289","type":"template","z":"8d3931b1.b63d6","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n<meta charset="UTF-8">\n\n\n\n<div id="chartContainer" style="height: 370px; max-width: 920px; margin: 0px auto;"><div class="canvasjs-chart-container" style="position: relative; text-align: left; cursor: auto;"><canvas class="canvasjs-chart-canvas" width="603" height="332" style="width: 671px; height: 370px; position: absolute;"><canvas class="canvasjs-chart-canvas" width="603" height="332" style="width: 671px; height: 370px; position: absolute; -webkit-tap-highlight-color: transparent; cursor: default;"><div class="canvasjs-chart-toolbar" style="position: absolute; right: 1px; top: 1px; border: 1px solid transparent;"><div class="canvasjs-chart-tooltip" style="position: absolute; height: auto; box-shadow: rgba(0, 0, 0, 0.1) 1px 1px 2px 2px; z-index: 1000; pointer-events: none; display: none; border-radius: 0px; left: 553px; bottom: -229px; transition: left 0.1s ease-out 0s, bottom 0.1s ease-out 0s;"><div style="width: auto; height: auto; min-width: 50px; margin: 0px; padding: 5px; font-family: "Trebuchet MS", Helvetica, sans-serif; font-weight: normal; font-style: normal; font-size: 14px; color: black; text-shadow: rgba(0, 0, 0, 0.1) 1px 1px 1px; text-align: left; border: 1px solid rgb(54, 158, 173); background: rgba(255, 255, 255, 0.9); text-indent: 0px; white-space: nowrap; border-radius: 0px; user-select: none;">04 Mar 17
<span style="color:#369EAD;">sensor1:  82.7
<span style="color:#C24642;">sensor2:  35.9
<span style="color:#7F6084;">sensor3:  43.9
<span style="color:#ed4912;">sensor4:  23\n<script src="/canvasjs.min.js">\n\n","output":"str","x":460,"y":3580,"wires":[["2b0df91b.758286"]]}]

0 Likes

#10

how can put data from file to template.

0 Likes

#11

Maybe this will help - https://flows.nodered.org/flow/92920b4fd450bf92a3035e061947daa0
It shows how to save data from a chart and restore it.
(It doesn't edit/search/slice it)

0 Likes

#12

its okay but i want to restore them in html chart

0 Likes

#13

the dashboard is html...
so you mean somewhere else ?

0 Likes

#14

i know .chart with html code in template in dashboard.
if you have time please see my code above.

0 Likes