469,575 Members | 1,498 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

Creating a radar graph using jpgraph

Hi all,

I am creating a radar chart containing 2 plots using jpgraph. My code is as follows:-

[PHP]
include ("./jpgraph/src/jpgraph.php");
include ("./jpgraph/src/jpgraph_radar.php");

// Create the basic radar graph
$graph = new RadarGraph(700,500,"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(1);

// Setup the grid lines
$graph->grid->SetLineStyle("longdashed");
//$graph->grid->SetColor("navy");
$graph->grid->SetColor("darkgray");
$graph->grid->Show();
$graph->HideTickMarks();

// Setup graph titles
$graph->title->Set("Essential Attributes Vs Population Mean");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->SetTitles(array("Attitude Towards Others","Meeting Standards","Job Ethic","Problem Solving","Respect For Property","Results Orientation","Attention To Detail","Consistency and Reliability"));

// Create the first radar plot
$plot = new RadarPlot(array(9.0,8.6,8.0,7.0,7.0,6.0,5.0,4.0));
$plot->SetLegend("Essential Talents");
$plot->SetColor("red","lightred");
$plot->SetFill(false);
$plot->SetLineWeight(1);

//$plot->mark->SetType(MARK_IMG_SBALL,'red');
$plot->mark->SetType(MARK_IMG_SBALL,'red');

// Create the second radar plot
$plot2 = new RadarPlot(array(6.0,7.0,7.0,7.1,7.5,8.0,8.0,8.1));
$plot2->SetLegend("Essential Talents: Population Mean");
$plot2->SetColor("blue","lightred");


// Add the plots to the graph
$graph->Add($plot2);
$graph->Add($plot);

// And output the graph
$graph->Stroke();
[/PHP]

However what I need is to display the data point values for plot2 beside every plot mark.. not able to figure that out.. hope someone can help.

Regards,
Sib
Jul 30 '08 #1
0 3090

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Frederes | last post: by
4 posts views Thread by Altramagnus | last post: by
9 posts views Thread by Patrick.O.Ige | last post: by
1 post views Thread by monomaniac21 | last post: by
5 posts views Thread by Kuna | last post: by
5 posts views Thread by Sonnich | last post: by
4 posts views Thread by riklaunim | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.