GNUAPP

graphpite(레이더차트) 사용하는법 문의드립니다.

· 2008-05-26 (월) 13:44:45 · 3358 · 1
sample12.png

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();
?>
|
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
08-05-26 조회 1,593
08-05-26 조회 913
08-05-26 조회 868
08-05-26 조회 3,359
08-05-26 조회 2,425
08-05-26 조회 827
08-05-26 조회 1,038
08-05-26 조회 850
08-05-26 조회 820
08-05-26 조회 1,058
08-05-26 조회 2,106
08-05-26 조회 1,240
08-05-26 조회 852
08-05-26 조회 803
08-05-26 조회 869
08-05-26 조회 784
08-05-26 조회 819
08-05-26 조회 829
08-05-26 조회 1,021
08-05-26 조회 823