Skip to content

Commit

Permalink
Fixed issue #10998: Simple statistic graphics wrong when label is too…
Browse files Browse the repository at this point in the history
… long
  • Loading branch information
LouisGac committed Apr 28, 2016
1 parent 8386cc7 commit 205beeb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion application/helpers/admin/statistics_helper.php
Expand Up @@ -2343,7 +2343,15 @@ protected function displaySimpleResults($outputs, $results, $rt, $outputType, $s
{
$cleanLabel = str_replace('"', " ", $label);
$cleanLabel = preg_replace( "/\r|\n/", "", $cleanLabel );
$labels[$key] = $cleanLabel;

// A line break would be better.
// But: https://github.com/chartjs/Chart.js/issues/608
if( strlen( $cleanLabel ) > 10 )
{
$cleanLabel = substr($cleanLabel, 0, 10).'...';
}

$labels[$key] = $cleanLabel;
$iMaxLabelLength = (strlen( $cleanLabel ) > $iMaxLabelLength)?strlen( $cleanLabel ):$iMaxLabelLength;
}

Expand Down

0 comments on commit 205beeb

Please sign in to comment.