Is it possible to use the canvas tag in HTML 4.01?
I was able to draw a graph using Chart.js in the following description, but I think the canvas tag can be used from HTML5.
If anyone knows, could you tell me?
Thank you for your cooperation.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<metacharset="utf-8">
<title> Graph </title>
</head>
<body>
<h1>Test Graph</h1>
<canvasid="myBarChart">/canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.bundle.js"></script>
<script>
varctx = document.getElementById("myBarChart");
var myBarChart = new Chart (ctx, {
type: 'bar',
data: {
labels: ['August 1', 'August 2', 'August 3', 'August 4', 'August 5', 'August 6', 'August 7',
datasets:
{
label: 'Number of people',
data: [10, 20, 30, 40, 55, 65, 70],
backgroundColor: "rgba (219, 39, 91, 0.5)"
}
]
},
options: {
title: {
display —true,
text: 'Number of people'
},
scale: {
yAxes: [{
ticks: {
SuggestedMax: 100,
SuggestedMin: 0,
stepSize:10,
callback:function(value, index, values){
return value + 'people'
}
}
}]
},
}
});
</script>
</body>
</html>
As mentioned in the questionnaire, HTML 4.01 does not support canvas tags.Some browsers may interpret and display them independently, but they are out of specification.
HTML5 was first recommended in 2014.Today, if HTML 4.01 can be avoided, it is better to avoid it.If you are particular about HTML 4.01, you will have to draw without using the canvas tag.Of course, you can't use Chart.js, so you'll have to use another method.
581 PHP ssh2_scp_send fails to send files as intended
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.