From c2ce6fd997dedad1de3838f0e5c21758096044d4 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Sun, 13 Sep 2009 19:14:13 +0000 Subject: [PATCH] Cheat: if only 1 day, prepend a day with 0 clicks before so the line graph is prettier git-svn-id: http://yourls.googlecode.com/svn/trunk@148 12232710-3e20-11de-b438-597f59cd7555 --- includes/functions-infos.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/functions-infos.php b/includes/functions-infos.php index 5d1276e..3e5df41 100644 --- a/includes/functions-infos.php +++ b/includes/functions-infos.php @@ -101,8 +101,12 @@ function yourls_stats_clicks_line( $dates ) { } } + if ( count( $list_of_days ) == 1 ) + array_unshift( $list_of_days, 0 ); + // Scale items $_list_of_days = yourls_scale_data( $list_of_days ); + // Make the chart $label_years = $first_year != $last_year ? join('|', $list_of_years ) : $first_year.'|'.$last_year; -- 2.45.0