Example #1
0
 public function freshChart()
 {
     $db = new MoboDB();
     $rate = $db->selectDefectRemovalRate();
     $categries = array();
     $series = array();
     foreach ($rate as $one) {
         array_push($categries, $one['version']);
         array_push($series, round((double) $one['rate'], 2));
     }
     $chart["xAxis"] = array("categories" => $categries);
     $chart["series"] = array(array("name" => "清除率", "type" => "line", "yAxis" => 0, "data" => $series));
     return $chart;
 }
Example #2
0
 /**
  * 从其他数据源获取数据
  */
 public function freshChart()
 {
     $db = new MoboDB();
     $bug1 = $db->selectBugOandC1();
     $bug2 = $db->selectBugOandC2();
     $db = null;
     $this->chart->data["series"][0]["data"] = array();
     $this->chart->data["series"][1]["data"] = array();
     foreach ($bug1 as $bug) {
         $abc = array("name" => $bug["name"], "y" => (int) $bug["y"], "color" => $bug["color"]);
         array_push($this->chart->data["series"][0]["data"], $abc);
     }
     foreach ($bug2 as $bug) {
         $name = $bug["name"] . $bug["y"] . "个";
         $abc = array("name" => $name, "y" => (int) $bug["y"], "color" => $bug["color"]);
         array_push($this->chart->data["series"][1]["data"], $abc);
     }
     $this->chart->improve();
     return $this->chart->getChartJson();
 }