private function createBarGraph()
 {
     // Create the graph.
     $graph = new Graph($this->width, $this->height, "auto");
     $graph->SetScale("textlin");
     $graph->title->SetFont(FF_FONT1, FS_BOLD);
     $graph->SetFrame(false);
     // ... and add it to the graph
     //$graph->xaxis->title->Set(Prado::localize('title'));
     //$graph->xaxis->SetTickLabels($this->xdata);
     //$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
     // First make the labels look right
     $graph->yaxis->SetLabelFormat('%d');
     $graph->yaxis->SetLabelSide(SIDE_LEFT);
     $graph->yaxis->SetLabelMargin(5);
     $graph->yaxis->scale->SetGrace(0.1);
     $graph->yaxis->HideZeroLabel();
     $graph->ygrid->SetFill(true, '#f2f2f2@0.5', '#cacaca@0.5');
     if ($this->shadow) {
         $graph->SetShadow();
     }
     // Create the bar plot
     $tmpArray = array();
     if ($this->numberdimensions > 1) {
         for ($ii = 1; $ii <= $this->numberpivots; $ii++) {
             for ($jj = 0; $jj < $this->numberchildren; $jj++) {
                 ${'tmpArray' . $ii . $jj} = array();
                 /*${'bplot'.$jj} = new BarPlot($this->ydata[$ii][$jj]);
                   ${'bplot'.$jj}->SetFillColor($this->colorarray[$jj]);
                   ${'bplot'.$jj}->value->Show();
                   ${'bplot'.$jj}->value->SetFormat('%d');
                   ${'bplot'.$jj}->value->SetColor("black");
                   ${'bplot'.$jj}->SetValuePos('top');
                   array_push(${'tmpArray'.$ii},${'bplot'.$jj});*/
                 array_push(${'tmpArray' . $ii . $jj}, $this->ydata[$ii][$jj]);
                 ${'bplot' . $ii . $jj} = new BarPlot(${'tmpArray' . $ii . $jj});
                 ${'bplot' . $ii . $jj}->SetFillColor($this->colorarray[$jj]);
                 ${'bplot' . $ii . $jj}->value->Show();
                 ${'bplot' . $ii . $jj}->value->SetFormat('%d');
                 ${'bplot' . $ii . $jj}->value->SetColor("black");
                 ${'bplot' . $ii . $jj}->SetValuePos('top');
                 //array_push($tmpArray,${'tmpArray'.$ii});
                 array_push($tmpArray, ${'bplot' . $ii . $jj});
             }
         }
         $gbplot = new GroupBarPlot($tmpArray);
         $gbplot->setWidth(0.9);
         $gbplot->SetLegend(Prado::localize($this->legend));
         $graph->Add($gbplot);
     } else {
         $tmpArray = array();
         for ($ii = 0; $ii < $this->numberpivots; $ii++) {
             array_push($tmpArray, $this->ydata[1][$ii]);
         }
         $bplot = new BarPlot($tmpArray);
         $bplot->value->Show();
         $bplot->value->SetFormat('%d');
         $bplot->value->SetColor("black");
         $bplot->SetValuePos('center');
         $bplot->SetWidth(0.8);
         $bplot->SetLegend(Prado::localize($this->legend));
         $graph->Add($bplot);
     }
     return $graph;
 }