php - Changing Text Size in Libchart -


i integrating libchart (the free php chart library) simple app purpose of drawing different types of graphs. have been able adapt use data changing size of generated graph. cant see change text size.in libchart, size of generated chart not specified , default small.

for vertical bar chart have following code:

 echo"<br />";     //include "libchart/classes/libchart.php";     echo '<h3><b>graph a</b></h3>';     $chart = new verticalbarchart(880,400);     $dataset = new xydataset();      if (!empty($pass_percent_eng))$dataset->addpoint(new point("english", $pass_percent_eng));     if (!empty($pass_percent_mat))$dataset->addpoint(new point("maths", $pass_percent_mat));     if (!empty($pass_percent_che))$dataset->addpoint(new point("chemistry", $pass_percent_che));     if (!empty($pass_percent_phy))$dataset->addpoint(new point("physics", $pass_percent_phy));     if (!empty($pass_percent_bio))$dataset->addpoint(new point("biology", $pass_percent_bio));      $chart->setdataset($dataset);     $chart->settitle("$school - pass percentage grade $grade$class, term $term, $year");      $chart->render("generated/demo.png");     echo '<img class="graph" alt="vertical bars chart" src="generated/demo.png" style="border: 1px solid gray;"/>'; 

i added length , width function $chart= new verticalbarchart(880,400).

que:

how adjust font size (if possible, font well) title text , text bars. have checked scripts in libchart not see anywhere adjust text, not seem have been set. guess may should defined in chart script since size of bar graph defined.

so far tried wrapping whole thing in div, , set text size class of div via css. had no joy that.

any appreciated.

may late but...

to change font size you'd have edit libchart\classes\view\text\text.php

line 63 $fontsize = 8; //change number

also line 115

doesn't seem parameterised.

to change font-face add .tff files font folder , change these lines 39/40 reference fonts, i'm using pts below:

$this->fontcondensed = $basedir . "fonts/pts55f-webfont.ttf";

$this->fontcondensedbold = $basedir . "fonts/pts75f-webfont.ttf";

hope helps.


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -