PluginProbe
SQL Chart Builder / 3.0.5
SQL Chart Builder v3.0.5
3.0.5 3.0.4 3.0.3 3.0.2 3.0.1 trunk 1.0.2 1.0.3 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.7.1 2.3.7.2 2.3.8 3.0.0
← All changes | functions.php +4 -3 3.0.43.0.5 View file →
@@ -985,11 +985,12 @@
985 985 }
986 986 return $has_point ? $out : false;
987 987 }
988 988
989 -// X scale options for time-axis mode; gvnSqlChartsTimeTick (asset/front.js) formats the ticks as dates
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
990 991 function guaven_sqlcharts_time_axis_scale(){
991 - return "type: 'linear', offset: true, ticks: {callback: gvnSqlChartsTimeTick, maxRotation: 45},";
992 + return "type: 'linear', offset: true, afterBuildTicks: gvnSqlChartsTimeTicks, ticks: {callback: gvnSqlChartsTimeTick, maxRotation: 45, autoSkip: true},";
992 993 }
993 994 // extra entry for the Chart.js "plugins" object in time-axis mode (tooltip title shown as a date)
994 995 function guaven_sqlcharts_time_axis_plugins($time_points){
995 996 return $time_points !== false ? 'tooltip: {callbacks: {title: gvnSqlChartsTimeTooltipTitle}}' : '';
@@ -1027,9 +1028,9 @@
1027 1028 echo wp_kses(guaven_sqlcharts_colorgenerator(count($points), 0, 0.2, guaven_sqlcharts_colors($i, $pid)),[]);
1028 1029 ?>
1029 1030 ],
1030 1031 borderWidth: 1,
1031 - <?php if ($time_points !== false) echo 'maxBarThickness: 48,'; ?>
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 ?>
1032 1033 data: [<?php
1033 1034 echo wp_kses(implode(",", $points),[]);
1034 1035 ?>],
1035 1036 },