private function drawBarChart($countArray, $nameArray, $title)
 {
     // Dataset definition
     $DataSet = new pData();
     $DataSet->AddPoint($countArray, "Serie1");
     $DataSet->AddPoint($nameArray, "Serie2");
     $DataSet->AddSerie("Serie1");
     $DataSet->SetAbsciseLabelSerie("Serie2");
     //data legend
     $DataSet->SetSerieName("Reports", "Serie1");
     $DataSet->SetYAxisName('Report Count');
     //$DataSet->SetXAxisName('Score');
     // Initialise the graph
     $Test = new pChart(700, 250);
     $font = "fonts/tahoma.ttf";
     $Test->loadColorPalette("fonts/pchart_palette.txt");
     //diagram size and style
     $Test->setFontProperties($font, 8);
     $offset = 25;
     $Test->setGraphArea(50 + $offset, 30, 620 + $offset, 200);
     $Test->drawFilledRoundedRectangle(7, 7, 693, 233, 5, 240, 240, 240);
     $Test->drawRoundedRectangle(5, 5, 695, 235, 5, 230, 230, 230);
     $Test->drawGraphArea(255, 255, 255, TRUE);
     $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, TRUE, 1);
     $Test->drawGrid(4, TRUE, 230, 230, 230, 50);
     //        // Draw the 0 line
     //        $Test->setFontProperties($font,6);
     //        $Test->drawTreshold(0,143,55,72,TRUE,TRUE);
     // Draw the bar graph
     $Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE, 80);
     // Finish the graph
     $Test->setFontProperties($font, 10);
     //$Test->drawLegend(610+$offset-5,140,$DataSet->GetDataDescription(),255,255,255);
     $Test->drawAxisLegend(10, 208, "Negative", 255, 255, 255, -1, -1, -1, 191, 50, 3);
     $Test->drawAxisLegend(610 + $offset - 5, 210, "Positive", 255, 255, 255, -1, -1, -1, 139, 203, 70);
     $Test->setFontProperties($font, 10);
     $Test->drawTitle(60 + $offset, 20, $title, 50, 50, 50, 585);
     $imageFile = "images/drip_bar_chart.png";
     $Test->Render($imageFile);
 }