DolGraph
class DolGraph (View source)
Class to build graphs.
Usage is:
$dolgraph=new DolGraph();
$dolgraph->SetTitle($langs->transnoentities('MyTitle').'
'.$langs->transnoentities('MyTitlePercent').'%');
$dolgraph->SetMaxValue(50);
$dolgraph->SetData($data);
$dolgraph->setShowLegend(2);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie'));
$dolgraph->setHeight('200');
$dolgraph->draw('idofgraph');
print $dolgraph->show($total?0:1);
Properties
| string[] | $type | ||
| string | $mode | ||
| array<array<string|int|float>> | $data | ||
| string | $title | ||
| string | $cssprefix | ||
| int|string | $width | ||
| int|string | $height | ||
| int | $MaxValue | ||
| int | $MinValue | ||
| int | $SetShading | ||
| float | $horizTickIncrement | ||
| float | $SetNumXTicks | ||
| float | $labelInterval | ||
| string | $YLabel | ||
| bool | $hideXGrid | ||
| bool | $hideXValues | ||
| bool | $hideYValues | ||
| bool | $hideYGrid | ||
| string[] | $Legend | ||
| float | $LegendWidthMin | ||
| int<0, 1> | $showlegend | ||
| int<0, 1> | $showpointvalue | ||
| int<0, 1> | $showpercent | ||
| float | $combine | ||
| object | $graph | ||
| bool | $mirrorGraphValues | ||
| null|string[] | $tooltipsTitles | ||
| null|string[] | $tooltipsLabels | ||
| string | $error | ||
| array<int<0, 2>, int>|array<int<0, 2>, array<int<0, 2>, int>> | $bordercolor | ||
| ?array<int<0, 2>, int> | $bgcolor | ||
| ?array<int<0, 2>, int> | $bgcolorgrid | ||
| array<int<0, 2>, array<int<0, 2>, int>> | $datacolor | ||
| float | $borderwidth | ||
| string | $borderskip |
Methods
Constructor
Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
Set label interval to reduce number of labels
Hide X grid
Hide X Values
Hide Y Values
Hide Y grid
Set y label
Set width
Set title
Set data
Set data color
Set border color
Set border width
Set border skip
Set tooltips labels of the graph
Set tooltips titles of the graph
Set type
Set legend
Set min width
Set max value
Get max value
Set min value
Get min value
Set height
Set shading
Set shading
Reset bg color
Reset bgcolorgrid
Mirror Values of the graph
Is graph ko
Show legend or not
Show pointvalue or not
Show percent or not
Define background color of complete image
Define background color of grid
Reset data color
Get max value among all values of all series
Return min value of all values of all series
Return max value of all data
Return min value of all data
Build a graph into memory using correct library (may also be wrote on disk, depending on library used)
Output HTML string to total value
Output HTML string ->stringtoshow to show the graph
getDefaultGraphSizeForStats
Details
__construct(string $library = 'auto')
Constructor
bool
SetHorizTickIncrement(float $xi)
Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
bool
SetNumXTicks(float $xt)
Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
bool
SetLabelInterval(float $x)
Set label interval to reduce number of labels
bool
SetHideXGrid(bool $bool)
Hide X grid
bool
setHideXValues(bool $bool)
Hide X Values
bool
setHideYValues(bool $bool)
Hide Y Values
bool
SetHideYGrid(bool $bool)
Hide Y grid
void
SetYLabel(string $label)
Set y label
void
SetWidth(int|string $w)
Set width
void
SetTitle(string $title)
Set title
void
SetData(array<array{0: string|int, 1: float, 2?: float}> $data)
Set data
void
SetDataColor(array<int<0, 2>, array<int<0, 2>, int>|string> $datacolor)
Set data color
void
setBorderColor(array<int<0, 2>, array<int<0, 2>, int>|string> $bordercolor)
Set border color
void
setBorderWidth(int $borderwidth)
Set border width
void
setBorderSkip("start"|"end"|"middle"|"false"|"true" $borderskip)
Set border skip
void
setTooltipsLabels(string[] $tooltipsLabels)
Set tooltips labels of the graph
void
setTooltipsTitles(string[] $tooltipsTitles)
Set tooltips titles of the graph
void
SetType(string[] $type)
Set type
void
SetLegend(string[] $legend)
Set legend
void
SetLegendWidthMin(int $legendwidthmin)
Set min width
void
SetMaxValue(int $max)
Set max value
int
GetMaxValue()
Get max value
void
SetMinValue(int $min)
Set min value
int
GetMinValue()
Get min value
void
SetHeight(int|string $h)
Set height
void
SetShading(int $s)
Set shading
void
SetCssPrefix(string $s)
Set shading
void
ResetBgColor()
Reset bg color
void
ResetBgColorGrid()
Reset bgcolorgrid
void
setMirrorGraphValues(bool $mirrorGraphValues)
Mirror Values of the graph
string
isGraphKo()
Is graph ko
void
setShowLegend(int $showlegend)
Show legend or not
void
setShowPointValue(int $showpointvalue)
Show pointvalue or not
void
setShowPercent(int $showpercent)
Show percent or not
void
SetBgColor(array{0: int, 1: int, 2: int}|"onglet"|"default" $bg_color = array(255, 255, 255))
Define background color of complete image
void
SetBgColorGrid("onglet"|"default"|array<int<0, 2>, int> $bg_colorgrid = array(255, 255, 255))
Define background color of grid
void
ResetDataColor()
Reset data color
?float
GetMaxValueInData()
Get max value among all values of all series
?float
GetMinValueInData()
Return min value of all values of all series
int
GetCeilMaxValue()
Return max value of all data
float
GetFloorMinValue()
Return min value of all data
mixed|bool
draw(string $file, string $fileurl = '')
Build a graph into memory using correct library (may also be wrote on disk, depending on library used)
float|int
total()
Output HTML string to total value
string
show(int|string $shownographyet = 0)
Output HTML string ->stringtoshow to show the graph
static int
getDefaultGraphSizeForStats(string $direction, string $defaultsize = '')
getDefaultGraphSizeForStats