if (($handle = fopen($csvfile, "r")) !== FALSE) { while (($data = fgetcsv($handle, 2000, ",")) !== FALSE) { $num = count($data); $row++; for ($c = 0; $c < $num; $c++) { if ($c % 2) { array_push($Numberofsearches, $data[$c]); } else { array_push($OrgDetails, $data[$c]); } } } } //print_r( $OrgDetails); //print_r ($Numberofsearches); require_once "/var/www/ChartDirector/lib/phpchartdir.php"; # Create a Bar object of size 360 x 300 pixels $c = new XYChart(810, 390); $c->addTitle($display_date . ' / ' . $display_org_type . ' / ' . $display_geo); # Set the plotarea at (30, 20) and of size 200 x 200 pixels $c->setPlotArea(40, 10, 640, 280, 0xe9fae7, 0xffffff); $barLayerObj = $c->addBarLayer($Numberofsearches, 0x8fc28a); $barLayerObj->set3D(); $barLayerObj->setBarShape(CircleShape); # Set the labels on the x axis. $c->xAxis->setLabels($OrgDetails); $c->xAxis->setLabelStyle("Arial", 8, TextColor, 30); # Add a title to the y axis $c->yAxis->setTitle("Searches"); $filename = $path . "/provider/charts/defaultimages/" . $imagename; $c->makeChart($filename);
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($c = 0; $c < $num; $c++) { if ($c % 2) { array_push($competitors, $data[$c]); } else { array_push($services, $data[$c]); } } } } require_once "/var/www/ChartDirector/lib/phpchartdir.php"; $c = new XYChart(780, 390); # Set the plotarea at (30, 20) and of size 200 x 200 pixels $c->setPlotArea(40, 5, 750, 200, 0xe9fae7, 0xffffff); # Add a title to the pie chart $c->addTitle($display_geo); # Add a line chart layer using the given data $barLayerObj = $c->addBarLayer($competitors, 0x70e17513); $barLayerObj->set3D(); $barLayerObj->setBarShape(CircleShape); # Set the labels on the x axis. $c->xAxis->setLabels($services); $c->xAxis->setLabelStyle("Arial", 8, TextColor, 45); # Add a title to the y axis $c->yAxis->setTitle("Count of Service Providers"); # Add a title to the x axis $c->xAxis->setTitle("Services"); $filename = $path . "/provider/charts/tempimages/" . $imagename; $c->makeChart($filename);
// Add a legend box at (50, 185) (below of plot area) using horizontal layout. Use 8 // pts Arial font with Transparent background. $legendObj = $c->addLegend(50, 45, false, "", 8); $legendObj->setBackground(Transparent); // Add a title box to the chart using 8 pts Arial Bold font, with yellow (0xffff40) // background and a black border (0x0) $textBoxObj = $c->addTitle("{$symb}.{$pf_exch}: {$symb_name}\n10 day Simple Moving Average Diff from {$first_date} to {$pf_working_date}", "arialbd.ttf", 12); // Set the y axis label format to US$nnnn $c->yAxis->setLabelFormat("£{value}"); // Set the labels on the x axis. $m_yearFormat = "{value|yyyy}"; $m_firstMonthFormat = "<*font=bold*>{value|mmm yy}"; $m_otherMonthFormat = "{value|mmm}"; $m_firstDayFormat = "<*font=bold*>{value|d mmm}"; $m_otherDayFormat = "{value|d}"; $m_firstHourFormat = "<*font=bold*>{value|d mmm\nh:nna}"; $m_otherHourFormat = "{value|h:nna}"; $m_timeLabelSpacing = 50; $c->xAxis->setMultiFormat(StartOfDayFilter(), $m_firstDayFormat, StartOfDayFilter(1, 0.5), $m_otherDayFormat, 1); $barLayerObj = $c->addBarLayer($ma_10_diff); $barLayerObj->setUseYAxis2(); $barLayerObj->setXData($dates); // Output the chart header("Content-type: image/png"); print $c->makeChart2(PNG); } else { return; } ?>
if (($handle = fopen($_SESSION['csvfile'], "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($c = 0; $c < $num; $c++) { array_push($counts, $data[$c]); #for } # While } fclose($handle); } else { echo "Error"; } require_once "/var/www/ChartDirector/lib/phpchartdir.php"; # Create a Bar object of size 360 x 300 pixels $c = new XYChart(500, 390); $c->addTitle('Service Providers Available by Type of Match'); # Set the plotarea at (30, 20) and of size 200 x 200 pixels $c->setPlotArea(20, 10, 440, 280, 0xe9fae7, 0xffffff); $barLayerObj = $c->addBarLayer($counts, 0x8fc28a); $barLayerObj->set3D(); $barLayerObj->setBarShape(CircleShape); # Set the labels on the x axis. $c->xAxis->setLabels($matchname); $c->xAxis->setLabelStyle("Arial", 8, TextColor, 30); # Add a title to the y axis $c->yAxis->setTitle("Service Providers Available"); $filename = $path . "/consumer/charts/" . $imagename; $_SESSION['imagename'] = $imagename; $c->makeChart($filename);