By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,929 Members | 634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,929 IT Pros & Developers. It's quick & easy.

Creating a radar graph using jpgraph

P: 6
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
Share this question for a faster answer!
Share on Google+

Post your reply

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