Creating a radar graph using jpgraph

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eureka2050
    New Member
    • Jul 2008
    • 6

    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.p hp");

    // Create the basic radar graph
    $graph = new RadarGraph(700, 500,"auto");

    // Set background color and shadow
    $graph->SetColor("whit e");
    $graph->SetShadow();

    // Position the graph
    $graph->SetCenter(0.4, 0.55);

    // Setup the axis formatting
    $graph->axis->SetFont(FF_FON T1,FS_BOLD);
    $graph->axis->SetWeight(1) ;

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

    // Setup graph titles
    $graph->title->Set("Essenti al Attributes Vs Population Mean");
    $graph->title->SetFont(FF_FON T1,FS_BOLD);
    $graph->SetTitles(arra y("Attitude Towards Others","Meetin g Standards","Job Ethic","Problem Solving","Respe ct For Property","Resu lts Orientation","A ttention To Detail","Consis tency 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("Ess ential Talents");
    $plot->SetColor("red" ,"lightred") ;
    $plot->SetFill(false) ;
    $plot->SetLineWeight( 1);

    //$plot->mark->SetType(MARK_I MG_SBALL,'red') ;
    $plot->mark->SetType(MARK_I MG_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("Ess ential 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
Working...