graphpite(레이더차트) 사용하는법 문의드립니다. 정보
graphpite(레이더차트) 사용하는법 문의드립니다.
본문
http://graphpite.sourceforge.net/samples/index.php?sample=12
그누보드 게시판의 여분필드로 레이더차트를 구현하는게 가능할까요?
검색으로 찾은 소스는 graphpite 입니다.
아래는 레이더차트 부분 php코드인데 어떻게 구현해야 할지 막막하여
이렇게 글을 남깁니다. 그누/php 고수님 도와주세요~
<?php
include("Image/Graph.php");
// create the graph
$Graph =& new Image_Graph(400, 300);
// create the plotareas
$PlotArea =& $Graph->add(new Image_Graph_PlotArea_Radar());
$PlotArea->addGridY(new Image_Graph_Grid_Lines());
// create the dataset
$DS1 =& new Image_Graph_Dataset_Random(6, 1, 6);
$DS2 =& new Image_Graph_Dataset_Random(6, 1, 6);
// create the 1st plot as smoothed area chart using the 1st dataset
$Plot =& $PlotArea->addPlot(new Image_Graph_Plot_Radar($DS1));
$Plot2 =& $PlotArea->addPlot(new Image_Graph_Plot_Radar($DS2));
// create a fill array
$BLUE =& $Graph->newColor(IMAGE_GRAPH_BLUE, 100);
$RED =& $Graph->newColor(IMAGE_GRAPH_RED, 100);
// set a standard fill style
$Plot->setFillStyle($BLUE);
$Plot2->setFillStyle($RED);
$DataPreprocessor =& new Image_Graph_DataPreprocessor_Array(
array(
"Life",
"Universe",
"Everything",
"Something",
"Nothing",
"Irrelevevant",
"Relevant",
"Partly",
"Regular",
"Irregular"
)
);
$Axis = $PlotArea->getAxis(IMAGE_GRAPH_AXIS_X);
$Axis->setDataPreprocessor($DataPreprocessor);
// add a TrueType font
$Arial =& $Graph->addFont(new Image_Graph_Font_TTF("arial.ttf"));
// set the font size to 15 pixels
$Arial->setSize(11);
// add a title using the created font
$Graph->add(new Image_Graph_Title("Spider/Radar Chart Sample", $Arial));
//$PlotArea->hideAxis();
// output the Graph
$Graph->done();
?>