Blame | Last modification | View Log | RSS feed
<?php#使用命名空間namespace qbpwcf;#匯入外部套件include("../allInOne.php");#提示目前要測試的套件echo "<hr>chartJS::barDemo- testCase 1<br>";/*#涵式說明:#顯示長條圖的demo.#回傳結果:#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.#$result["error"],錯誤訊息.#$result["content"],語法.#$result["function"],當前執行的函數名稱.#必填參數:#$conf["libAddr"],字串,爲ckfEditor套件的網路位置,js附檔名會自動補上.$conf["libAddr"]="../lib/Chart.js/Chart.min";#可省略參數:#$conf["fileArgu"],字串,為當前檔案的路徑,預設為__FILE__.$conf["fileArgu"]=__FILE__;#參考資料:#Creating a Chart=>http://www.chartjs.org/docs/latest/$barDemo=chartJS::barDemo($conf);unset($conf);if($barDemo["status"]==="false"){#印出訊息var_dump($barDemo);#結束程式exit;}#if end#印出內容echo $barDemo["content"];*/#提示目前要測試的套件echo "<hr>chartJS::barDemo- testCase 1<br>";/*#涵式說明:#將數據用長條圖表示.#回傳結果:#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.#$result["error"],錯誤訊息.#$result["content"],語法.#$result["function"],當前執行的函數名稱.#必填參數:#$conf["libAddr"],字串,爲chartJS的位置,js附檔名會自動補上.$conf["libAddr"]="../lib/Chart.js/Chart.min";#$conf["data"],字串,要繪製的數據,例如:"20170709 508.25 20170716 1365 20170723 949 20170730 455 20170806 917 20170813 0".$conf["data"]="2017/07/09 508.25 2017/07/16 1365 2017/07/23 949 2017/07/30 455 2017/08/06 917 2017/08/13 0";#$conf["canvasId"],字串,為要繪製圖表到哪個canvas元素的id.$conf["canvasId"]="mychart";#$conf["title"],字串,圖表的標題.$conf["title"]="Statistics Report";#conf["yTitle"],字串,y軸標題.$conf["yTitle"]="Amount";#conf["xTitle"],字串,x軸標題.$conf["xTitle"]="Week";#可省略參數:#$conf["fileArgu"],字串,為當前檔案的路徑,預設為__FILE__.$conf["fileArgu"]=__FILE__;#$conf["dataUnit"],字串,數據的單位,預設為"number";$conf["dataUnit"]="amount";#$conf["yTcolor"],字串,y軸標題顏色與透明度,例如:"0,0,255,0.8"就代表紅光0,綠光0,藍光255,透明度0.2.#$conf["yTcolor"]="";#$conf["xTcolor"],字串,x軸標題顏色與透明度,例如:"0,0,255,0.8"就代表紅光0,綠光0,藍光255,透明度0.2.#$conf["xTcolor"]="";#參考資料:#Creating a Chart=>http://www.chartjs.org/docs/latest/$bar=chartJS::bar($conf);unset($conf);#如果產生語法錯誤if($bar["status"]==="false"){#印出訊息var_dump($bar);#結束程式exit;}#if end#繪製圖表的元素位置echo "<canvas id='mychart'></canvas>";#印出內容echo $bar["content"];*/?>