| @@ -985,12 +985,11 @@ | ||
| 985 | 985 | } |
| 986 | 986 | return $has_point ? $out : false; |
| 987 | 987 | } |
| 988 | 988 | |
| 989 | -// X scale options for time-axis mode (globals from asset/front.js): gvnSqlChartsTimeTicks replaces the evenly | |
| 990 | -// spaced ticks Chart.js generates on a linear scale with the actual data dates, gvnSqlChartsTimeTick formats them | |
| 989 | +// X scale options for time-axis mode; gvnSqlChartsTimeTick (asset/front.js) formats the ticks as dates | |
| 991 | 990 | function guaven_sqlcharts_time_axis_scale(){ |
| 992 | - return "type: 'linear', offset: true, afterBuildTicks: gvnSqlChartsTimeTicks, ticks: {callback: gvnSqlChartsTimeTick, maxRotation: 45, autoSkip: true},"; | |
| 991 | + return "type: 'linear', offset: true, ticks: {callback: gvnSqlChartsTimeTick, maxRotation: 45},"; | |
| 993 | 992 | } |
| 994 | 993 | // extra entry for the Chart.js "plugins" object in time-axis mode (tooltip title shown as a date) |
| 995 | 994 | function guaven_sqlcharts_time_axis_plugins($time_points){ |
| 996 | 995 | return $time_points !== false ? 'tooltip: {callbacks: {title: gvnSqlChartsTimeTooltipTitle}}' : ''; |
| @@ -1028,9 +1027,9 @@ | ||
| 1028 | 1027 | echo wp_kses(guaven_sqlcharts_colorgenerator(count($points), 0, 0.2, guaven_sqlcharts_colors($i, $pid)),[]); |
| 1029 | 1028 | ?> |
| 1030 | 1029 | ], |
| 1031 | 1030 | borderWidth: 1, |
| 1032 | - <?php if ($time_points !== false) echo 'barThickness: 24,'; // fixed width: on a time axis Chart.js would otherwise size bars from the closest pair of dates ?> | |
| 1031 | + <?php if ($time_points !== false) echo 'maxBarThickness: 48,'; ?> | |
| 1033 | 1032 | data: [<?php |
| 1034 | 1033 | echo wp_kses(implode(",", $points),[]); |
| 1035 | 1034 | ?>], |
| 1036 | 1035 | }, |