Skip to content

Commit

Permalink
Fixed #7894: Bar chart looses numeric indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed May 31, 2013
1 parent b982a10 commit 7a33952
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions application/helpers/admin/statistics_helper.php
Expand Up @@ -208,17 +208,23 @@ function createChart($iQuestionID, $iSurveyID, $type=null, $lbl, $gdata, $grawda
// this block is to remove the items with value == 0
// and an inelegant way to remove comments from List with Comments questions
$i = 0;
$j = 0;
$labelTmp = array();
while (isset ($gdata[$i]))
{
$aHelperArray=array_keys($lbl);
if ($gdata[$i] == 0 || ($sQuestionType == "O" && substr($aHelperArray[$i],0,strlen($oLanguage->gT("Comments")))==$oLanguage->gT("Comments")))
{
array_splice ($gdata, $i, 1);
array_splice ($lbl, $i, 1);
}
else
{$i++;}
{
$i++;
$labelTmp = $labelTmp + array_slice($lbl, $j, 1, true); // Preserve numeric keys for the labels!
}
$j++;
}
$lbl = $labelTmp;

if ($language=='ar')
{
Expand Down

0 comments on commit 7a33952

Please sign in to comment.