Re: [請益] 新手發問 希望有大大可以指導
<?php
include ("../jpgraph.php");
include ("../jpgraph_radar.php");
// Create the basic rtadar graph
$graph = new RadarGraph(300,200,"auto");
// Set background color and shadow
$graph->SetColor("white");
$graph->SetShadow();
// Position the graph
$graph->SetCenter(0.4,0.55);
// Setup the axis formatting
$graph->axis->SetFont(FF_FONT1,FS_BOLD);
$graph->axis->SetWeight(2);
// Setup the grid lines
$graph->grid->SetLineStyle("longdashed");
$graph->grid->SetColor("navy");
$graph->grid->Show();
$graph->HideTickMarks();
// Setup graph titles
$graph->title->Set("Quality result");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->SetTitles(array("One","Two","Three","Four","Five","Sex","Seven","Eight","Nine","Ten"));
// Create the first radar plot
$plot = new RadarPlot(array(30,80,60,40,71,81,47,60));
$plot->SetLegend("Goal");
$plot->SetColor("red","lightred");
$plot->SetFill(false);
$plot->SetLineWeight(2);
// Create the second radar plot
$plot2 = new RadarPlot(array(70,40,30,80,31,51,14,80,90));
$plot2->SetLegend("Actual");
$plot2->SetColor("blue","lightred");
// Add the plots to the graph
$graph->Add($plot2);
$graph->Add($plot);
// And output the graph
$graph->Stroke();
?>
以上是完整的程式碼.....
小的只是想把 資料庫裡面的資料 套用在
$plot = new RadarPlot(array(30,80,60,40,71,81,47,60));
這一行 而已.....
如果改成
$nb= @mysql_fetch_array($result);
$plot = new RadarPlot ($nb[]);
就會出現
Warning: Wrong parameter count for max() in c:\appserv\www\jpgraph-1.16\src\
jpgraph_radar.php on line 309
Warning: Wrong parameter count for min() in c:\appserv\www\jpgraph-1.16\
src\jpgraph_radar.php on line 305
JpGraph Error: Each spider plot must have the same number of data points.
不知道該怎樣把資料庫的值 變成符合這程式要的型態....
感謝大大 點閱這篇文章>W<
抱歉 程式碼很冗長 能否有大大指導 小的把檔案傳給你比較方便@@"...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.229.197.199
推
11/04 15:22, , 1F
11/04 15:22, 1F
→
11/04 15:28, , 2F
11/04 15:28, 2F
※ 編輯: dcplay01 來自: 125.229.217.237 (11/04 15:51)
※ 編輯: dcplay01 來自: 125.229.217.237 (11/04 15:52)
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
151
156