forked from rampr/gChartPhp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gFormula.php
36 lines (34 loc) · 999 Bytes
/
gFormula.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace gchart;
class gFormula extends gChart
{
/**
* @param $widht Integer It is set by default to 0 because the server will size the png automatically
* @param $height Integer It is set by default to 0 because the server will size the png automatically
*/
function __construct($width = 0, $height = 0)
{
$this->setDimensions($width, $height);
$this->setProperty('cht','tx');
}
public function setLatexCode($latexCode)
{
$this->setProperty('chl', urlencode($latexCode));
}
public function setTextColor($textColor)
{
$this->setProperty('chco', $textColor);
}
public function getImgCode()
{
$code = '<img src="';
$code .= $this->getUrl().'"';
$code .= 'alt="gChartPhp Chart"';
if($this->width)
$code .= ' width='.$this->width;
if($this->height)
$code .= ' height='.$this->height;
$code .= '>';
print($code);
}
}