Helloooo Guys, im stuck with something I have a single line chart that should pick data from specific column on database sum it and display it in chart
<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", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"],
datasets: [{
label: "Vanzare Lunara",
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [600, 800, 100, 16, 20, 21, 22, 23, 25, 26, 26],
}]
},
// Configuration options go here
options: {}
});
</script>
This is the script that picks the data (600, 800, 100, etc)
the database name is highmob_comenzi it needs to pick data from 2 tables and colums and sum it table 1 - players , column totalvanzare
table 2 - vanzari , column totalvanzare
any ideea how to do it? :(