1$(document).ready(function() { 2 createChart(); 3}); 4 5 6 7 8function createChart() { 9 $.ajax({ 10 type: 'GET', 11 url: '/php/getTradeHistoryMonth.php', 12 13 success: function(res) { 14 var obj = JSON.parse(res); 15 var barChartData = { 16 labels: obj.date, 17 datasets: [{ 18 label: 'LOSS', 19 backgroundColor: '#e04c3d', 20 data: obj.loss 21 }, { 22 label: 'WIN', 23 backgroundColor: '#44ddb8', 24 data: obj.win 25 }] 26 27 }; 28 29 30 Chart.defaults.global.defaultFontColor = 'white'; 31 32 var ctx = document.getElementById('canvas').getContext('2d'); 33 window.myBar = new Chart(ctx, { 34 type: 'bar', 35 data: barChartData, 36 options: { 37 tooltips: { 38 mode: 'index', 39 intersect: false 40 }, 41 responsive: true, 42 scales: { 43 xAxes: [{ 44 stacked: true, 45 }], 46 yAxes: [{ 47 stacked: true 48 }], 49 }, 50 legend: { 51 labels: { 52 // This more specific font property overrides the global property 53 fontColor: 'white' 54 }, 55 position: 'bottom' 56 } 57 } 58 }); 59 }, 60 error: function(response) { 61 console.log(response); 62 return false; 63 } 64 }); 65 }; 66 67 68
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.