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);
array_push($matchdate, $data[$c]); } } } fclose($handle); } array_shift($count); array_shift($matchdate); // echo "matchdate"; // print_r($matchdate); // print_r($count); require_once "/var/www/ChartDirector/lib/phpchartdir.php"; # Create a XYChart object of size 250 x 250 pixels $c = new XYChart(780, 390); # Set the plotarea at (30, 20) and of size 200 x 200 pixels $c->setPlotArea(40, 10, 700, 290, 0xe9fae7, 0xffffff); # Add a title to the pie chart $c->addTitle($display_date); # Add a line chart layer using the given data $lineObj = $c->addLineLayer($count, 0x70e17513); $lineObj->set3D(); $c->yAxis->setTickDensity(30); $c->xAxis->setTickDensity(75); # Set the labels on the x axis. $c->xAxis->setLabels($matchdate); # Add a title to the y axis $c->yAxis->setTitle("Searches"); # Add a title to the x axis $c->xAxis->setTitle("Days"); $labelsObj = $c->xAxis->setLabels($matchdate); $labelsObj->setFontAngle(70);
$open[] = $row['open']; $close[] = $row['close']; $high[] = $row['high']; $low[] = $row['low']; $ema_12[] = $row['ema_12']; $ema_26[] = $row['ema_26']; $dates[] = chartTime2(strtotime($row['date'])); if ($first) { // save the first found date for the chart title $first_date = $row['date']; $first = false; } } // Set the plotarea at (50, 30) and of size 240 x 140 pixels. Use white (0xffffff) // background. $plotAreaObj = $c->setPlotArea(50, 45, 410, 400, 0xffffff, 0xffffff, 0xc0c0c0, 0xc0c0c0, 0xc0c0c0); // 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, 455, 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}\nExponential Moving Averages from {$first_date} to {$pf_working_date}", "arialbd.ttf", 12); // Set the y axis label format to US$nnnn $c->yAxis->setLabelFormat("£{value}"); $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}";
foreach ($pdo->query($query) as $row) { if ($first) { $first_date = $row['date']; $first = false; } $last_date = $row['date']; $holdings[] = $row['holdings']; $cash_in_hand[] = $row['cash_in_hand']; $dates[] = chartTime2(strtotime($row['date'])); } // Create a XYChart object of size 300 x 210 pixels. Set the background to pale yellow // (0xffffc0) with a black border (0x0) $c = new XYChart(640, 480); // Set the plotarea at (50, 30) and of size 240 x 140 pixels. Use white (0xffffff) // background. $plotAreaObj = $c->setPlotArea(50, 30, 560, 400); $plotAreaObj->setBackground(0xffffff); // 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(250, 445, 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("{$name} ({$pfid}) Performance ({$first_date} to {$last_date})", "arialbd.ttf", 8); $textBoxObj->setBackground(0xffff40, 0); // Set the y axis label format to US$nnnn $c->yAxis->setLabelFormat("£{value}"); // Set the labels on the x axis. // Display 1 out of 2 labels on the x-axis. Show minor ticks for remaining labels. $m_yearFormat = "{value|yyyy}"; $m_firstMonthFormat = "<*font=bold*>{value|mmm yy}";
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);
foreach ($pdo->query($query) as $row) { $a_d_spread[] = $row['adv_dec_spread']; $a_d_line[] = $row['adv_dec_line']; $a_d_ratio[] = $row['adv_dec_ratio']; $dates[] = chartTime2(strtotime($row['date'])); if ($count == 0) { // save the first found date for the chart title $first_date = $row['date']; } $count++; } // Set the plotarea at (50, 30) and of size 240 x 140 pixels. Use white (0xffffff) // background. $plotAreaObj1 = $c1->setPlotArea(50, 45, 410, 100, 0xffffff, 0xffffff, 0xc0c0c0, 0xc0c0c0, 0xc0c0c0); $plotAreaObj2 = $c2->setPlotArea(50, 45, 410, 100, 0xffffff, 0xffffff, 0xc0c0c0, 0xc0c0c0, 0xc0c0c0); $plotAreaObj3 = $c3->setPlotArea(50, 45, 410, 100, 0xffffff, 0xffffff, 0xc0c0c0, 0xc0c0c0, 0xc0c0c0); // Add a legend box at (50, 185) (below of plot area) using horizontal layout. Use 8 // pts Arial font with Transparent background. $legendObj1 = $c1->addLegend(50, 45, false, "", 8); $legendObj1->setBackground(Transparent); $legendObj2 = $c2->addLegend(50, 45, false, "", 8); $legendObj2->setBackground(Transparent); $legendObj3 = $c3->addLegend(50, 45, false, "", 8); $legendObj3->setBackground(Transparent); // Add a title box to the chart using 8 pts Arial Bold font, with yellow (0xffff40) // background and a black border (0x0) $m->addTitle("{$pf_exch_name} Breadth indicators from {$first_date} to {$pf_working_date}", "arialbd.ttf", 12); // Set the y axis label format to US$nnnn $m_yearFormat = "{value|yyyy}"; $m_firstMonthFormat = "<*font=bold*>{value|mmm yy}"; $m_otherMonthFormat = "{value|mmm}";
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);