Esempio n. 1
0
 public function getChartData()
 {
     header("Content-Type: text/javascript");
     $paycoinDb = new PaycoinDb();
     $chart = $this->bootstrap->route['chart'];
     if (!$chart) {
         $chart = 'outstanding';
     }
     switch ($chart) {
         case 'transactions-per-block':
             $dataPoints = $paycoinDb->getTransactionsPerBlockDataPoints(100000);
             break;
         case 'difficulty':
             $dataPoints = $paycoinDb->getDifficultyDataPoints(100000);
             break;
         default:
             $dataPoints = $paycoinDb->getOutstandingDataPoints(100000000);
     }
     echo $this->bootstrap->httpRequest->get('callback') . "( [ \n";
     echo join($dataPoints, ",");
     echo "\n ]);\n";
 }