Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $.ajax({
- url : "gleichrichter_mix.php",
- type : "GET",
- success : function(data){
- console.log(data);
- var ID = [];
- var Gesamtwirkleistung = [];
- var Gesamtscheinleistung = [];
- var Gesamtblindleistung = [];
- for(var i in data) {
- ID.push("ID " + data[i].ID);
- Gesamtwirkleistung.push(data[i].Gesamtwirkleistung);
- Gesamtscheinleistung.push(data[i].Gesamtscheinleistung);
- Gesamtblindleistung.push(data[i].Gesamtblindleistung);
- }
- var chartdata = {
- labels: ID,
- datasets: [
- {
- label: "Gesamtwirkleistung",
- fill: false,
- lineTension: 0.1,
- backgroundColor: "rgba(59, 89, 152, 0.75)",
- borderColor: "rgba(59, 89, 152, 1)",
- pointHoverBackgroundColor: "rgba(59, 89, 152, 1)",
- pointHoverBorderColor: "rgba(59, 89, 152, 1)",
- data: Gesamtwirkleistung
- },
- {
- label: "Gesamtscheinleistung",
- fill: false,
- lineTension: 0.1,
- backgroundColor: "rgba(29, 202, 255, 0.75)",
- borderColor: "rgba(29, 202, 255, 1)",
- pointHoverBackgroundColor: "rgba(29, 202, 255, 1)",
- pointHoverBorderColor: "rgba(29, 202, 255, 1)",
- data: Gesamtscheinleistung
- },
- {
- label: "Gesamtblindleistung",
- fill: false,
- lineTension: 0.1,
- backgroundColor: "rgba(211, 72, 54, 0.75)",
- borderColor: "rgba(211, 72, 54, 1)",
- pointHoverBackgroundColor: "rgba(211, 72, 54, 1)",
- pointHoverBorderColor: "rgba(211, 72, 54, 1)",
- data: Gesamtblindleistung
- }
- ]
- };
- var ctx = $("#mycanvas");
- var LineGraph = new Chart(ctx, {
- type: 'line',
- data: chartdata
- });
- },
- error : function(data) {
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement