<?php
require_once("../lib/phpchartdir.php");
$data0 = array('data'=>$model,'attributes'=>array('quantity'));
$data1 = array('data'=>$model,'attributes'=>array('quality'));
$data2 = array('data'=>$model,'attributes'=>array('academicAbility'));
$data3 = array('data'=>$model,'attributes'=>array('abilityToLearnAndKnowledge'));
$data4 = array('data'=>$model,'attributes'=>array('practicalAbility'));
$data5 = array('data'=>$model,'attributes'=>array('judgmentAndDecision'));
$data6 = array('data'=>$model,'attributes'=>array('manageAndPlan'));
$data7 = array('data'=>$model,'attributes'=>array('communicateSkill'));
$data8 = array('data'=>$model,'attributes'=>array('languageAndCultural'));
$data9 = array('data'=>$model,'attributes'=>array('suitabilityPosition'));
$data10 = array('data'=>$model,'attributes'=>array('respondAndDepend'));
$data11 = array('data'=>$model,'attributes'=>array('interest'));
$data12 = array('data'=>$model,'attributes'=>array('imitativeSelfStart'));
$data13 = array('data'=>$model,'attributes'=>array('responSupervisor'));
$data14 = array('data'=>$model,'attributes'=>array('personality'));
$data15 = array('data'=>$model,'attributes'=>array('interpersonalSkill'));
$data16 = array('data'=>$model,'attributes'=>array('disciplineAdaptFormalOrganize'));
$data17 = array('data'=>$model,'attributes'=>array('ehticMorality'));
# The data for the line chart
$data = array($data0,$data1,$data2,$data3,$data4,$data5,$data6,$data7,$data8,$data9,$data10,$data11,$data12,$data13,$data14,$data15,$data16,$data17);
# The labels for the line chart
$labels = array("Quantity of Work",
"Quality of Work",
"Academic Ability ",
"Ability To Learn And Knowledge ",
"Practical Ability ",
"Judgment and Decision Marking ",
"Management and Planning ",
"Communication Skill ",
"Foreign Language and Cultural Development ",
"Suitability for Job Position ",
"Responsibility and Dependability ",
"Interest in Work ",
"Imitative of Self Starter ",
"Response to Supervisor",
"Personality ",
"Interpersonal Skill ",
"Discipline and Adaptability to Formal Organization",
"Ethics and Morality ");
# Create a XYChart object of size 500 x 320 pixels, with a pale purpule (0xffccff)
# background, a black border, and 1 pixel 3D border effect.
$c = new XYChart(920, 680, 0xffccff, 0x000000, 1);
# Set the plotarea at (55, 45) and of size 420 x 210 pixels, with white background.
# Turn on both horizontal and vertical grid lines with light grey color (0xc0c0c0)
$c->setPlotArea(200, 130, 620, 350, 0xffffff, -1, -1, 0xc0c0c0, -1);
# Add a legend box at (55, 25) (top of the chart) with horizontal layout. Use 8 pts
# Arial font. Set the background and border color to Transparent.
$legendObj = $c->addLegend(65, 32, false, "", 15);
$legendObj->setBackground(Transparent);
# Add a title box to the chart using 13 pts Times Bold Italic font. The text is white
# (0xffffff) on a purple (0x800080) background, with a 1 pixel 3D border.
$textBoxObj = $c->addTitle("The Score For Evaluate Company", "timesbi.ttf", 16, 0xffffff);
$textBoxObj->setBackground(0x800080, -1, 1);
# Add a title to the y axis
$c->yAxis->setTitle("SCORE");
$c->yAxis->setLinearScale(0,6,1,1);
# Set the labels on the x axis. Rotate the font by 90 degrees.
$labelsObj = $c->xAxis->setLabels($labels);
$labelsObj->setFontAngle(50);
# Add a line layer to the chart
$lineLayer = $c->addLineLayer();
# Add the data to the line layer using light brown color (0xcc9966) with a 7 pixel
# square symbol
$dataSetObj = $lineLayer->addDataSet($data, 0xcc9966, "Student Evaluate");
$dataSetObj->setDataSymbol(SquareSymbol, 10);
# Set the line width to 2 pixels
$lineLayer->setLineWidth(5);
# Add a trend line layer using the same data with a dark green (0x008000) color. Set
# the line width to 2 pixels
#$trendLayerObj = $c->addTrendLayer($data, 0x008000, "Trend Line");
#$trendLayerObj->setLineWidth(2);
# Output the chart
header("Content-type: image/png");
print($c->makeChart2(PNG));
?>
อันนี้คือตัว Views ครับ
Code (PHP)
<br>
<h1>View Graph #<?php echo $model->idStudent; ?></h1>
<td align = 'center'>
<iframe marginheight=0 frameborder="0" marginwidth=0 scrolling=no
src= "../graph/php/trendline.php?DD=<?php echo $_FILES?>" name="php"
style= "position:relative; width:1060px; height:700px; visibility: visible; z-index:l;">
Iframes are not supported by this browser.
</iframe>
</td>