} $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}"; $m_otherMonthFormat = "{value|mmm}"; $m_firstDayFormat = "<*font=bold*>{value|d mmm}"; $m_otherDayFormat = "{value|d}"; $m_firstHourFormat = "<*font=bold*>{value|d mmm\nh:nna}";
$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}"; $m_otherHourFormat = "{value|h:nna}"; $m_timeLabelSpacing = 50; $c->xAxis->setMultiFormat(StartOfDayFilter(), $m_firstDayFormat, StartOfDayFilter(1, 0.5), $m_otherDayFormat, 1);
$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}"; $m_firstDayFormat = "<*font=bold*>{value|d mmm\nyyyy}"; $m_otherDayFormat = "{value|d}"; $m_firstHourFormat = "<*font=bold*>{value|d mmm\nh:nna}"; $m_otherHourFormat = "{value|h:nna}"; if ($count < 370) { $format = $m_firstDayFormat; } else {