PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 4.16.19
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v4.16.19
4.16.19 4.16.18 4.16.17 4.16.16 trunk 1.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5a 1.1.6 1.1.7 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7 1.7.1 1.7.2 1.8 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.1.9 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.2 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.10.2 4.10.3 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.15.0 4.15.1 4.15.10 4.15.11 4.15.12 4.15.13 4.15.14 4.15.15 4.15.16 4.15.17 4.15.18 4.15.19 4.15.2 4.15.20 4.15.20.1 4.15.21 4.15.22 4.15.23 4.15.24 4.15.25 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.0 4.16.1 4.16.10 4.16.11 4.16.12 4.16.13 4.16.14 4.16.15 4.16.2 4.16.3 4.16.4 4.16.5 4.16.6 4.16.7 4.16.8 4.16.9 4.2.0 4.3.0 4.3.1 4.3.2 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.7.0 4.8.0 4.9.0
wp-user-avatar / assets / js / admin / reports.js
wp-user-avatar / assets / js / admin Last commit date
chart.js 1 month ago chart.min.js 1 month ago digital-files-chooser.js 1 month ago fusewp.js 1 month ago index.php 1 month ago license.js 1 month ago login-redirect.js 1 month ago reports.js 1 month ago reports.min.js 1 month ago tax-rate-repeater.js 1 month ago
reports.js
298 lines
1 (function ($) {
2
3 function format_amount(amount) {
4 return currencySymbol.replace(/[0-9.,]+/, amount);
5 }
6
7 $(window).on('load', function () {
8
9 if (document.getElementById('ppress-report-revenue')) {
10
11 $('#ppress-mode-filter select').on('change', function () {
12 $('#ppress-date-filters').toggle(this.value === 'custom');
13 }).trigger('change');
14
15 const revenueConfig = {
16 type: 'line',
17 data: {
18 labels: revenueStat.label,
19 datasets: revenueStat.dataset
20 },
21 options: {
22 responsive: true,
23 interaction: {
24 mode: 'index',
25 intersect: false,
26 },
27 stacked: false,
28 scales: {
29 y: {
30 type: 'linear',
31 display: true,
32 position: 'left',
33 // https://www.chartjs.org/docs/latest/samples/scale-options/ticks.html
34 ticks: {
35 // Include a dollar sign in the ticks
36 callback: function (value, index, ticks) {
37 return format_amount(value);
38 }
39 }
40 }
41 },
42 plugins: {
43 tooltip: {
44 callbacks: {
45 label: function (context) {
46 let label = context.dataset.label || '';
47
48 if (label) {
49 label += ': ';
50 }
51 if (context.parsed.y !== null) {
52 label += format_amount(context.parsed.y);
53 }
54 return label;
55 }
56 }
57 },
58 legend: {
59 display: false
60 }
61 }
62 },
63 };
64
65 const taxesConfig = {
66 type: 'line',
67 data: {
68 labels: taxesStat.label,
69 datasets: taxesStat.dataset
70 },
71 options: {
72 responsive: true,
73 interaction: {
74 mode: 'index',
75 intersect: false,
76 },
77 stacked: false,
78 scales: {
79 y: {
80 type: 'linear',
81 display: true,
82 position: 'left',
83 // https://www.chartjs.org/docs/latest/samples/scale-options/ticks.html
84 ticks: {
85 // Include a dollar sign in the ticks
86 callback: function (value, index, ticks) {
87 return format_amount(value);
88 }
89 }
90 }
91 },
92 plugins: {
93 tooltip: {
94 callbacks: {
95 label: function (context) {
96 let label = context.dataset.label || '';
97
98 if (label) {
99 label += ': ';
100 }
101 if (context.parsed.y !== null) {
102 label += format_amount(context.parsed.y);
103 }
104 return label;
105 }
106 }
107 },
108 legend: {
109 display: false
110 }
111 }
112 },
113 };
114
115 const ordersConfig = {
116 type: 'line',
117 data: {
118 labels: orderStat.label,
119 datasets: orderStat.dataset
120 },
121 options: {
122 responsive: true,
123 interaction: {
124 mode: 'index',
125 intersect: false,
126 },
127 stacked: false,
128 scales: {
129 y: {
130 type: 'linear',
131 position: 'left',
132 }
133 }
134 },
135 };
136
137 const refundConfig = {
138 type: 'line',
139 data: {
140 labels: refundStat.label,
141 datasets: refundStat.dataset
142 },
143 options: {
144 responsive: true,
145 interaction: {
146 mode: 'index',
147 intersect: false,
148 },
149 stacked: false,
150 scales: {
151 y: {
152 type: 'linear',
153 display: true,
154 position: 'left',
155 }
156 },
157 plugins: {
158 legend: {
159 display: false
160 }
161 }
162 },
163 };
164
165 const topPlanConfig = {
166 type: 'line',
167 data: {
168 labels: topPlansStat.label,
169 datasets: topPlansStat.dataset
170 },
171 options: {
172 responsive: true,
173 interaction: {
174 mode: 'index',
175 intersect: false,
176 },
177 stacked: false,
178 scales: {
179 y: {
180 type: 'linear',
181 stacked: true,
182 position: 'left',
183 },
184 y1: {
185 type: 'linear',
186 position: 'right',
187 // grid line settings
188 grid: {
189 drawOnChartArea: false, // only want the grid lines for one axis to show up
190 },
191 ticks: {
192 // Include a dollar sign in the ticks
193 callback: function (value, index, ticks) {
194 return format_amount(value);
195 }
196 }
197 },
198 },
199 plugins: {
200 tooltip: {
201 callbacks: {
202 label: function (context) {
203 let label = context.dataset.label || '';
204
205 if (label) label += ': ';
206
207 if (context.parsed.y !== null) {
208
209 if (context.dataset.borderColor === 'rgb(255, 99, 132)') {
210 label += format_amount(context.parsed.y);
211 } else {
212 label += context.parsed.y;
213 }
214 }
215 return label;
216 }
217 }
218 },
219 legend: {
220 display: false
221 }
222 }
223 },
224 };
225
226 const paymentMethodsConfig = {
227 type: 'line',
228 data: {
229 labels: paymentMethodsStat.label,
230 datasets: paymentMethodsStat.dataset
231 },
232 options: {
233 responsive: true,
234 interaction: {
235 mode: 'index',
236 intersect: false,
237 },
238 stacked: false,
239 scales: {
240 y: {
241 type: 'linear',
242 stacked: true,
243 position: 'left',
244 },
245 y1: {
246 type: 'linear',
247 position: 'right',
248 // grid line settings
249 grid: {
250 drawOnChartArea: false, // only want the grid lines for one axis to show up
251 },
252 ticks: {
253 // Include a dollar sign in the ticks
254 callback: function (value, index, ticks) {
255 return format_amount(value);
256 }
257 }
258 },
259 },
260 plugins: {
261 tooltip: {
262 callbacks: {
263 label: function (context) {
264 let label = context.dataset.label || '';
265
266 if (label) label += ': ';
267
268 if (context.parsed.y !== null) {
269
270 if (context.dataset.borderColor === 'rgb(255, 99, 132)') {
271 label += format_amount(context.parsed.y);
272 } else {
273 label += context.parsed.y;
274 }
275 }
276 return label;
277 }
278 }
279 },
280 legend: {
281 display: false
282 }
283 }
284 },
285 };
286
287 new Chart(document.getElementById('ppress-report-revenue'), revenueConfig);
288 new Chart(document.getElementById('ppress-report-orders'), ordersConfig);
289 if ($('#ppress-report-tax').length > 0) {
290 new Chart(document.getElementById('ppress-report-tax'), taxesConfig);
291 }
292 new Chart(document.getElementById('ppress-report-refunds'), refundConfig);
293 new Chart(document.getElementById('ppress-report-top-plans'), topPlanConfig);
294 new Chart(document.getElementById('ppress-report-payment-methods'), paymentMethodsConfig);
295 }
296 });
297
298 })(jQuery);