作者dcplay01 (dcplay)
看板PHP
标题Re: [请益] 新手发问 希望有大大可以指导
时间Sun Nov 4 12:52:29 2007
<?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
1F:推 kasase:你有检查出来的array就是7组数字吗? 11/04 15:22
2F:→ dcplay01:里面是八组数字 11/04 15:28
※ 编辑: dcplay01 来自: 125.229.217.237 (11/04 15:51)
※ 编辑: dcplay01 来自: 125.229.217.237 (11/04 15:52)