I am trying to utilize chart.js in my zoho site. I can not get anything other than a blank screen.
I first tried to put all three sections in the code snippet:
<canvas id="myChart"></canvas>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [{
label: "My First dataset",
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45],
}]
},
// Configuration options go here
options: {}
});
</script>
Then I tried to put the first script in the header code and leave the rest in the code snippet.
Then I tried to put both scripts in the header code.
Nothing. Blank page.
Upon inspecting elements, I see that I am getting the following error:
ReferenceError: Can't find variable: Chart
Any assistance would be greatly appreciated. Thank you in advance.
Steven