I have issue with my chart. I would like to add more than one value in my chart which is generating from table(Add gold,gas) . Can anybody gives me any ideas to solve a problem?(chartjs library)
<table id="fetch" cellspacing="5" cellpadding="8" class="table" >
<tr>
<th>Date</th>
<th>Prize</th>
</tr>
<script type="text/javascript">
var dane = [
["2019-08-01",6.25],
["2019-09-01",4.15],
["2019-10-01",10.23],
["2019-11-01",7.56],
["2019-12-01",0.00],
["2020-01-01",12.43],
["2020-02-01",11.25],
["2020-03-01",13.64],
["2020-04-01",10.20],
["2020-05-01",15.32]],
fetch = document.getElementById('fetch');
for(var i=0; i <dane.length; i++){
var newRow = fetch.insertRow(fetch.length);
for(var j=0; j<dane[i].length; j++){
var cell = newRow.insertCell(j);
cell.innerHTML = dane[i][j];
}
}
</script>
<script>
const labels = [];
const data = {
labels: labels,
datasets: [{
label: 'Oil',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: dane,
}]
};
const config = {
type: 'line',
data: data,
options: {
},
};
</script>