+1

AJAX and Canvas

Hello, i'm experimenting a bit with an esp32 and a network. The ESP32 measures a temperature which I then display on a web page. This works with AJAX etc. The temperature value is cyclically sent and displayed. Now I want to display the temperature as a graph. For example with a pointer. Can anyone help me with a simple example? I do not understand the use of CANVAS in this problem. many thanks and greetings

1/31/2020 12:25:09 PM

Jürgen

6 Answers

New Answer

+4

Do you wanna draw something like a chart ? I think you can use chart.js https://code.sololearn.com/WeD60RcuAtZ3/?ref=app

+4

See this video https://youtu.be/PVPQR7tMtHc Do you want something like this ?

+2

See this Canvas Tutorial https://www.sololearn.com/learn/HTML/2201/

+1

https://www.sololearn.com/learn/HTML/2201/ Das geht nicht...

0

Hello, Thanks for the info. Unfortunately the first link does not work. I understand how something is drawn with canvas, it works too. Unfortunately I can't manage to update the canvas drawing regularly. This is my problem. The numerical values are updated, that works. Regards...

0

Hi, thanks for the Example. Here is my Code: https://code.sololearn.com/WNA2eThYsZq8/#html A canvas drawing area is created and a red rectangle and line are drawn. I want the line to be drawn differently depending on the value. So like a hand of a clock. I do not want to work with the Chart Lib. It is called GetAjaxData every 250ms and the values are displayed as numbers. I would like to draw a pointer parallel to this. greetings...