I am looking to integrate the "temp" data variable, identified by ID within (.list), from the provided Json () as an x-axis variable in the chart below:
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 src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a8cbc0c9dadc86c2dbe89a86908698">[email protected]</a>"></script>
<canvas id="myChart"></canvas>
The chart is currently operational without the Json data. How can I import this specific data to replace the existing "data: [0, 10, 5, 2, 20, 30, 45]" variables?