chart-body.php
6 years ago
earning-report-top-menu.php
6 years ago
report-date_range.php
6 years ago
report-last_month.php
6 years ago
report-last_week.php
6 years ago
report-last_year.php
6 years ago
report-this_month.php
6 years ago
report-this_week.php
6 years ago
report-this_year.php
6 years ago
report.php
6 years ago
statement.php
6 years ago
statements.php
6 years ago
chart-body.php
43 lines
| 1 | |
| 2 | |
| 3 | <canvas id="tutorChart" style="width: 100%; height: 400px;"></canvas> |
| 4 | <script> |
| 5 | var ctx = document.getElementById("tutorChart").getContext('2d'); |
| 6 | var tutorChart = new Chart(ctx, { |
| 7 | type: 'line', |
| 8 | data: { |
| 9 | labels: <?php echo json_encode(array_keys($chartData)); ?>, |
| 10 | datasets: [{ |
| 11 | label: 'Earning', |
| 12 | backgroundColor: '#3057D5', |
| 13 | borderColor: '#3057D5', |
| 14 | data: <?php echo json_encode(array_values($chartData)); ?>, |
| 15 | borderWidth: 2, |
| 16 | fill: false, |
| 17 | lineTension: 0, |
| 18 | }] |
| 19 | }, |
| 20 | options: { |
| 21 | scales: { |
| 22 | yAxes: [{ |
| 23 | ticks: { |
| 24 | min: 0, // it is for ignoring negative step. |
| 25 | beginAtZero: true, |
| 26 | callback: function(value, index, values) { |
| 27 | if (Math.floor(value) === value) { |
| 28 | return value; |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | }] |
| 33 | }, |
| 34 | |
| 35 | legend: { |
| 36 | display: false |
| 37 | } |
| 38 | } |
| 39 | }); |
| 40 | </script> |
| 41 | |
| 42 | |
| 43 |