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