本文整理汇总了PHP中LinePlot::setThickness方法的典型用法代码示例。如果您正苦于以下问题:PHP LinePlot::setThickness方法的具体用法?PHP LinePlot::setThickness怎么用?PHP LinePlot::setThickness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinePlot
的用法示例。
在下文中一共展示了LinePlot::setThickness方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process()
{
parent::process();
$this->setPmvTitle($this->graph);
$this->setPmvBackgroundGradient($this->graph);
/**
* group (bar + line)
*/
$group = new PlotGroup();
$this->setPmvGroupProperties($group);
$group->axis->right->setColor(new Red());
$group->axis->right->label->setFont(new Font2());
/**
* line
*/
$plot = new LinePlot($this->y2, LINEPLOT_MIDDLE);
$plot->setColor(new Red());
$plot->setThickness(1);
$plot->setYAxis(PLOT_RIGHT);
$group->legend->add($plot, $this->y2Legend, LEGEND_MARK);
$group->add($plot);
/**
* vertical bar
*/
$plot = new BarPlot($this->y1);
$plot->grid->setType(LINE_DASHED);
$this->setPmvPadding($plot);
$this->setPmvBackgroundGradient($plot);
$this->setPmvBarBorderProperties($plot);
$this->setPmvBarShadowProperties($plot);
$this->setPmvLabelProperties($plot, $this->y1);
$this->setPmvBarGradient($plot);
$this->setPmvBarSize($plot);
//$plot->xAxis->setColor( new Color( 50, 97, 243) );
//$plot->yAxis->setColor( new Color( 50, 97, 243) );
//$plot->xAxis->label->setFont($this->font20);
$group->axis->bottom->setLabelText($this->x);
$group->axis->bottom->setPadding(0, 0, 100, 0);
// display one axis label on two because too long for Mar 04 Apr 04 etc.
if (isset($this->interval)) {
$group->axis->bottom->label->setInterval(2);
}
$group->legend->add($plot, $this->y1Legend, LEGEND_BACKGROUND);
$group->add($plot);
/**
* add group to graph
*/
$this->graph->add($group);
}
示例2: draw_artichow
//.........这里部分代码省略.........
// On boucle sur chaque lot de donnees
$legends = array();
$i = 0;
$nblot = count($this->data[0]) - 1;
while ($i < $nblot) {
$x = 0;
$values = array();
foreach ($this->data as $key => $valarray) {
$legends[$x] = $valarray[0];
$values[$x] = $valarray[$i + 1];
$x++;
}
// We fix unknown values to null
$newvalues = array();
foreach ($values as $val) {
$newvalues[] = is_numeric($val) ? $val : null;
}
if ($this->type[0] == 'bars') {
//print "Lot de donnees $i<br>";
//print_r($values);
//print '<br>';
$color = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2], 20);
$colorbis = new Color(min($this->datacolor[$i][0] + 50, 255), min($this->datacolor[$i][1] + 50, 255), min($this->datacolor[$i][2] + 50, 255), 50);
$colorgrey = new Color(100, 100, 100);
$colorborder = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]);
if ($this->mode == 'side') {
$plot = new BarPlot($newvalues, $i + 1, $nblot);
}
if ($this->mode == 'depth') {
$plot = new BarPlot($newvalues, 1, 1, ($nblot - $i - 1) * 5);
}
$plot->barBorder->setColor($colorgrey);
//$plot->setBarColor($color);
$plot->setBarGradient(new LinearGradient($colorbis, $color, 90));
if ($this->mode == 'side') {
$plot->setBarPadding(0.1, 0.1);
}
if ($this->mode == 'depth') {
$plot->setBarPadding(0.1, 0.4);
}
if ($this->mode == 'side') {
$plot->setBarSpace(5);
}
if ($this->mode == 'depth') {
$plot->setBarSpace(2);
}
$plot->barShadow->setSize($this->SetShading);
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
$plot->barShadow->smooth(TRUE);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
}
if ($this->type[0] == 'lines') {
$color = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2], 20);
$colorbis = new Color(min($this->datacolor[$i][0] + 20, 255), min($this->datacolor[$i][1] + 20, 255), min($this->datacolor[$i][2] + 20, 255), 60);
$colorter = new Color(min($this->datacolor[$i][0] + 50, 255), min($this->datacolor[$i][1] + 50, 255), min($this->datacolor[$i][2] + 50, 255), 90);
$plot = new LinePlot($newvalues);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
$plot->setColor($color);
$plot->setThickness(1);
// Set line background gradient
$plot->setFillGradient(new LinearGradient($colorter, $colorbis, 90));
$plot->xAxis->setLabelText($legends);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
//$plot->setYAxis(0);
//$plot->hideLine(true);
}
//$plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures
$group->legend->setTextFont(new $artichow_defaultfont(10));
// This is to force Artichow to use awFileFontDriver to
// solve a bug in Artichow with UTF8
if (count($this->Legend)) {
if ($this->type[0] == 'bars') {
$group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
}
if ($this->type[0] == 'lines') {
$group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
}
}
$group->add($plot);
$i++;
}
$group->axis->bottom->setLabelText($legends);
$group->axis->bottom->label->setFont(new $artichow_defaultfont(7));
//print $group->axis->bottom->getLabelNumber();
if ($this->labelInterval > 0) {
$group->axis->bottom->setLabelInterval($this->labelInterval);
}
$graph->add($group);
// Generate file
$graph->draw($file);
$this->_stringtoshow = '<!-- Build using ' . $this->_library . ' --><img src="' . $fileurl . '" title="' . dol_escape_htmltag($this->title ? $this->title : $this->YLabel) . '" alt="' . dol_escape_htmltag($this->title ? $this->title : $this->YLabel) . '">';
}
示例3: color
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
function color($a = NULL)
{
if ($a === NULL) {
$a = mt_rand(20, 80);
}
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
$graph = new Graph(400, 400, "Abel", time() + 5);
$graph->setTiming(TRUE);
$graph->setAntiAliasing(TRUE);
$x = array();
for ($i = 0; $i < 10; $i++) {
$x[] = mt_rand(0, 100);
}
$plot = new LinePlot($x);
$plot->setThickness(1);
$plot->setColor(color());
$plot->setFillGradient(new LinearGradient(color(), color(), 0));
$plot->grid->setType(LINE_DASHED);
$plot->setYMin(mt_rand(-20, 0));
$plot->yAxis->setLabelNumber(mt_rand(0, 10));
$plot->yAxis->setLabelPrecision(1);
$plot->xAxis->label->hideFirst(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 2);
$plot->setXAxisZero((bool) mt_rand(0, 1));
$graph->add($plot);
$graph->draw();
示例4: Artichow_Line
/**
* Формирование графика.
*
* Функция формирует, а затем записывает в файл ($File) изображение графика по
* переданным пользователем данным($Lines). Данная функция может рисовать как одиночные,
* так и многолинейные графики.Исходными данными является массив, элементы которого также
* является массивами исходных данных для соответствующих графиков (данная структура
* сохраняется и для одиночных графиков!). Цвет каждой линии передается в массиве
* $Colors, ключи которого совпадают с ключами массива исходных данных. Цвет задается
* шестнадцатиричным кодом цвета (например, 0x000000 для черного цвета).
*
* @param string <заголовок диаграммы>
* @param string <полный путь с именем файла-результата>
* @param array <исходные данные>
* @param array <подписи к оси Ox>
* @param array <цвета линий>
*/
function Artichow_Line($Name, $File, $Lines, $Labels, $Colors)
{
#-----------------------------------------------------------------------------
$Graph = new Graph(1000, 300);
$Graph->setDriver('gd');
$Graph->setAntiAliasing(TRUE);
#-----------------------------------------------------------------------------
$Graph->title->set($Name);
$Graph->title->setFont(new Tuffy(15));
$Graph->title->move(0, -5);
#-----------------------------------------------------------------------------
if (Count($Lines) > 1) {
#---------------------------------------------------------------------------
$Group = new PlotGroup();
$Group->setPadding(40, 40);
$Group->setBackgroundColor(new Color(240, 240, 240));
}
#-----------------------------------------------------------------------------
$IsSetLabel = FALSE;
#-----------------------------------------------------------------------------
foreach ($Lines as $LineID => $Line) {
#---------------------------------------------------------------------------
$Plot = new LinePlot($Line);
$Color = Color_RGB_Explode($Colors[$LineID]);
$Plot->setColor(new Color($Color['R'], $Color['G'], $Color['B']));
$Plot->setThickness(1);
$Plot->setBackgroundGradient(new LinearGradient(new Color(240, 240, 240), new Color(255, 255, 255), 0));
$Plot->setFillGradient(new LinearGradient(new LightOrange(10), new VeryLightOrange(90), 90));
$Plot->setPadding(50, 50, 50, 50);
#---------------------------------------------------------------------------
$Plot->mark->setType(Mark::CIRCLE);
$Plot->mark->setSize(5);
#---------------------------------------------------------------------------
$Plot->label->set($Line);
$Plot->label->move(0, -15);
$Plot->label->setBackgroundGradient(new LinearGradient(new Color(250, 250, 250, 10), new Color(255, 200, 200, 30), 0));
$Plot->label->border->setColor(new Color(20, 20, 20, 20));
$Plot->label->setPadding(2, 2, 2, 2);
#---------------------------------------------------------------------------
if (Count($Lines) < 2) {
#-------------------------------------------------------------------------
$Plot->xAxis->setLabelText($Labels);
$Plot->yAxis->setLabelPrecision(1);
} else {
#-------------------------------------------------------------------------
if (!$IsSetLabel) {
#-----------------------------------------------------------------------
$Plot->setXAxis(Plot::BOTTOM);
$IsSetLabel = TRUE;
}
}
#---------------------------------------------------------------------------
if (Count($Lines) > 1) {
$Group->add($Plot);
}
#---------------------------------------------------------------------------
if (Count($Lines) > 1) {
#-------------------------------------------------------------------------
$Graph->add($Group);
#-------------------------------------------------------------------------
$Group->axis->bottom->setTickStyle(0);
$Group->axis->bottom->setLabelText($Labels);
} else {
$Graph->add($Plot);
}
}
#-----------------------------------------------------------------------------
$Graph->draw($File);
#-----------------------------------------------------------------------------
return TRUE;
}
示例5: Color
//.........这里部分代码省略.........
$legends[$j] = $valarray[0];
$values[$j] = $valarray[$i+1];
$j++;
}
// Artichow ne gere pas les valeurs inconnues
// Donc si inconnu, on la fixe a null
$newvalues=array();
foreach($values as $val)
{
$newvalues[]=(is_numeric($val) ? $val : null);
}
if ($this->type == 'bars')
{
//print "Lot de donnees $i<br>";
//print_r($values);
//print '<br>';
$color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20);
$colorbis=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),50);
$colorgrey=new Color(100,100,100);
$colorborder=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]);
if ($this->mode == 'side') $plot = new BarPlot($newvalues, $i+1, $nblot);
if ($this->mode == 'depth') $plot = new BarPlot($newvalues, 1, 1, ($nblot-$i-1)*5);
$plot->barBorder->setColor($colorgrey);
//$plot->setBarColor($color);
$plot->setBarGradient( new LinearGradient($colorbis, $color, 90) );
if ($this->mode == 'side') $plot->setBarPadding(0.1, 0.1);
if ($this->mode == 'depth') $plot->setBarPadding(0.1, 0.4);
if ($this->mode == 'side') $plot->setBarSpace(5);
if ($this->mode == 'depth') $plot->setBarSpace(2);
$plot->barShadow->setSize($this->SetShading);
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
$plot->barShadow->smooth(TRUE);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
}
if ($this->type == 'lines')
{
$color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20);
$colorbis=new Color(min($this->datacolor[$i][0]+20,255),min($this->datacolor[$i][1]+20,255),min($this->datacolor[$i][2]+20,255),60);
$colorter=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),90);
$plot = new LinePlot($newvalues);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
$plot->setColor($color);
$plot->setThickness(1);
// Set line background gradient
$plot->setFillGradient( new LinearGradient($colorter, $colorbis, 90) );
$plot->xAxis->setLabelText($legends);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
//$plot->setYAxis(0);
//$plot->hideLine(true);
}
//$plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures
$group->legend->setTextFont(new Tuffy(10)); // This is to force Artichow to use awFileFontDriver to
// solve a bug in Artichow with UTF8
if (sizeof($this->Legend))
{
if ($this->type == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
if ($this->type == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
}
$group->add($plot);
$i++;
}
$group->axis->bottom->setLabelText($legends);
$group->axis->bottom->label->setFont(new Tuffy(7));
//print $group->axis->bottom->getLabelNumber();
if ($this->labelInterval > 0) $group->axis->bottom->setLabelInterval($this->labelInterval);
$graph->add($group);
// Generate file
$graph->draw($file);
}
示例6: Color
$group = new PlotGroup;
$group->setPadding(40, 40);
$group->setBackgroundColor(
new Color(240, 240, 240)
);
$nbre_courbes=count($data);
$i=0;
$values=Array();
foreach($data as $key=>$type) {
foreach($type as $value) {
$values[$i][]=$value;
}
$plot = new LinePlot($values[$i]);
$color=new color(rand(0,200),rand(0,200),rand(0,200));
$plot->setColor($color);
$plot->setThickness(2);
$group->legend->add($plot, $key, Legend::LINE);
$group->legend->setPosition(1, 0.25);
$group->add($plot);
$i++;
}
$group->axis->bottom->setLabelText($months);
$graph->add($group);
$graph->draw();
?>
示例7: array
$x = array(20, 25, 20, 18, 16, 25, 29, 12, 15, 18, 21, 26);
$plot = new BarPlot($x, 2, 2);
$plot->setBarColor(new Color(120, 175, 80, 10));
$plot->setBarPadding(0.15, 0.15);
$plot->barShadow->setSize(3);
$plot->barShadow->smooth(TRUE);
$plot->barShadow->setColor(new Color(200, 200, 200, 10));
$group->legend->add($plot, "Green bar", LEGEND_BACKGROUND);
$group->add($plot);
// Add a second bar plot
$x = array(12, 14, 10, 9, 10, 16, 12, 8, 8, 10, 12, 13);
$plot = new BarPlot($x, 2, 2);
$plot->setBarColor(new Orange());
$plot->setBarPadding(0.15, 0.15);
$group->legend->add($plot, "Orange bar", LEGEND_BACKGROUND);
$group->add($plot);
// Add a line plot
$x = array(6, 5, 6, 5.5, 4.5, 4, 4.5, 4, 5, 4, 5, 5.5);
$plot = new LinePlot($x, LINEPLOT_MIDDLE);
$plot->setColor(new DarkBlue());
$plot->setThickness(5);
$plot->setYAxis(PLOT_RIGHT);
$plot->setYMax(12);
$plot->mark->setType(MARK_CIRCLE);
$plot->mark->setSize(6);
$plot->mark->setFill(new LightBlue());
$plot->mark->border->show();
$group->legend->add($plot, "Blue line", LEGEND_MARK);
$group->add($plot);
$graph->add($group);
$graph->draw();
示例8: color
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
function color($a = NULL)
{
if ($a === NULL) {
$a = mt_rand(0, 100);
}
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
$graph = new Graph(400, 300);
$graph->setBackgroundColor(new Color(175, 175, 175));
$x = array(mt_rand(-20, 20), 42, mt_rand(-20, 20), 15, 80, 42, 42, mt_rand(-20, 20));
$plot = new LinePlot($x);
$plot->setBackgroundImage(new FileImage("42.png"));
$plot->setAbsSize(350, 250);
$plot->setCenter(0.5, 0.5);
$plot->setThickness(mt_rand(4, 6));
$plot->setFillColor(color());
$plot->grid->setColor(new Color(0, 200, 42));
$plot->grid->hide(FALSE);
$plot->grid->setColor(new Color(255, 25, 160));
$plot->yAxis->label->hideFirst(FALSE);
$plot->yAxis->label->setFont(new Font2());
$plot->xAxis->setNumberByTick('minor', 'major', 2);
$plot->xAxis->label->hideFirst(TRUE);
$graph->add($plot);
$graph->draw();
示例9: color
*
*/
require_once "../../LinePlot.class.php";
function color()
{
return new Color(mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 100));
}
$width = mt_rand(200, 400);
$graph = new Graph($width, 400);
$graph->setAntiAliasing(TRUE);
$graph->setBackgroundColor(new Color(50, 50, 50));
$x = array(-100, 35, -20, 15, 79, -50);
$plot = new LinePlot($x);
$plot->setAbsSize($width - 20, 380);
$plot->setAbsPosition(mt_rand(0, 20), mt_rand(0, 20));
$plot->setThickness(mt_rand(2, 5));
$plot->setBackgroundGradient(new LinearGradient(color(), color(), mt_rand(0, 1) * 90));
$plot->yAxis->setLabelNumber(mt_rand(0, 10));
/*
$plot->setYMin(-80);
$plot->setYMax(120);
*/
$plot->xAxis->setLabelInterval(2);
$plot->xAxis->setTickInterval(2);
$major = $plot->xAxis->tick('major');
$major->setSize(10);
$minor = $plot->xAxis->tick('minor');
$minor->setSize(6);
$plot->xAxis->setNumberByTick('minor', 'major', 4);
$plot->xAxis->label->hideFirst(TRUE);
$plot->grid->setType(LINE_DOTTED);
示例10: draw
public function draw($format = false)
{
/* Make sure we have GD support. */
if (!function_exists('imagecreatefromjpeg')) {
die;
}
if ($format === false) {
$format = IMG_PNG;
}
$group = new PlotGroup();
$graph = new Graph($this->width, $this->height);
$graph->setFormat($format);
$graph->setBackgroundColor(new Color(0xf4, 0xf4, 0xf4));
$graph->shadow->setSize(3);
$graph->title->set($this->title);
$graph->title->setFont(new Tuffy(10));
$graph->title->setColor(new Color(0x0, 0x0, 0x8b));
$graph->border->setColor(new Color(187, 187, 187, 15));
$plot = new BarPlot($this->xValues);
$plot->setBarColor(new $this->color());
$plot->barBorder->hide(true);
$plot->setBarGradient(new LinearGradient(new $this->color(), new White(), 0));
$plot->setBarPadding(0.2, 0.2);
$group->axis->bottom->setLabelText($this->xLabels);
$group->axis->bottom->label->setFont(new Tuffy(8));
$plot2 = new LinePlot($this->xValues, LinePlot::MIDDLE);
$plot2->setColor(new DarkBlue());
$plot2->setThickness(1);
if (GRAPH_TREND_LINES) {
$group->add($plot2);
}
$group->add($plot);
$graph->add($group);
$graph->draw();
}