Create an LCD screen with the HTML Canvas
This example shows how to create an LCD screen on a dashboard using the HTML Canvas widget.
HTML:
<div id="image_background">
<p>Last value:</p>
<span id="image_background_text">No data</span>
</div>CSS:
@import url('https://fonts.googleapis.com/css?family=VT323');
#image_background {
background: url('https://i.imgur.com/uuYygjz.png') 0 / contain no-repeat;
font-family: "VT323";
font-size: 25px;
letter-spacing: 10.5px;
height: 220px;
width: 450px;
}
#image_background p, #image_background_text {
margin: 0;
left: 75px;
position: absolute;
}
#image_background p {
top: 88px;
font-size: 25px !important;
}
#image_background_text {
top: 121px;
}
JavaScript:
In the following code, set VAR_ID to the variable ID to display:
Once you save the settings, it looks like this:

Adjusting the screen's contrast
Update the HTML to:
Update the CSS to:
Update the JavaScript to:
Lastly, add the third-party library required for this implementation:
Result:

Last updated
Was this helpful?