protected function drawTriggers() { if ($this->m_showTriggers != 1) { return; } // if($this->num != 1) return; // skip multiple graphs $opposite = hex2rgb(GRAPH_TRIGGER_LINE_OPPOSITE_COLOR); $oppColor = imagecolorallocate($this->im, $opposite[0], $opposite[1], $opposite[2]); foreach ($this->triggers as $tnum => $trigger) { if ($trigger['skipdraw']) { continue; } $triggerColor = $this->getColor($trigger['color']); $lineStyle = array($triggerColor, $triggerColor, $triggerColor, $triggerColor, $triggerColor, $oppColor, $oppColor, $oppColor); // SDI($trigger['color']); dashedline($this->im, $this->shiftXleft, $trigger['y'], $this->sizeX + $this->shiftXleft, $trigger['y'], $lineStyle); dashedline($this->im, $this->shiftXleft, $trigger['y'] + 1, $this->sizeX + $this->shiftXleft, $trigger['y'] + 1, $lineStyle); } }
protected function drawGrid() { $this->drawSmallRectangle(); if ($this->column) { $hline_count = $this->gridLinesCount; for ($i = 1; $i < $hline_count; $i++) { dashedline($this->im, $this->shiftXleft + $this->shiftXCaptionLeft, $i * ($this->sizeY / $hline_count) + $this->shiftY + $this->shiftYCaptionTop, $this->sizeX + $this->shiftXleft + $this->shiftXCaptionLeft, $i * ($this->sizeY / $hline_count) + $this->shiftY + $this->shiftYCaptionTop, $this->getColor('Gray')); } $i = 0; foreach ($this->series as $key => $serie) { $caption = $this->periodCaption[$key]; $caption = str_pad($caption, $this->maxCaption, ' ', STR_PAD_LEFT); imagestringup($this->im, 1, $i * ($this->seriesWidth + $this->seriesDistance) + $this->shiftXleft + $this->shiftXCaptionLeft + round($this->seriesWidth / 2), $this->sizeY + $this->shiftY + $this->shiftYCaptionBottom, $caption, $this->getColor('Black No Alpha')); $i++; } } else { $vline_count = $this->gridLinesCount; for ($i = 1; $i < $vline_count; $i++) { dashedline($this->im, $i * ($this->sizeX / $vline_count) + $this->shiftXleft + $this->shiftXCaptionLeft, $this->shiftY + $this->shiftYCaptionTop, $i * ($this->sizeX / $vline_count) + $this->shiftXleft + $this->shiftXCaptionLeft, $this->sizeY + $this->shiftY + $this->shiftYCaptionTop, $this->getColor('Gray')); } $i = 0; foreach ($this->series as $key => $serie) { $caption = $this->periodCaption[$key]; $caption = str_pad($caption, $this->maxCaption, ' ', STR_PAD_LEFT); imagestring($this->im, 1, $this->shiftXleft, $this->sizeY + $this->shiftY + $this->shiftYCaptionTop - ($i * ($this->seriesWidth + $this->seriesDistance) + $this->seriesDistance + round($this->seriesWidth / 2)), $caption, $this->getColor('Black No Alpha')); $i++; } } }
protected function drawTriggers() { if ($this->m_showTriggers != 1) { return; } if ($this->num != 1) { return; } // skip multiple graphs foreach ($this->triggers as $trigger) { dashedline($this->im, $this->shiftXleft, $trigger['y'], $this->sizeX + $this->shiftXleft, $trigger['y'], $this->getColor($trigger['color'])); } }
protected function drawGrid() { $this->drawSmallRectangle(); if ($this->column) { $hline_count = $this->gridLinesCount; for ($i = 1; $i < $hline_count; $i++) { dashedline($this->im, $this->shiftXleft + $this->shiftXCaptionLeft, $i * ($this->sizeY / $hline_count) + $this->shiftY + $this->shiftYCaptionTop, $this->sizeX + $this->shiftXleft + $this->shiftXCaptionLeft, $i * ($this->sizeY / $hline_count) + $this->shiftY + $this->shiftYCaptionTop, $this->getColor('Gray')); } $i = 0; foreach ($this->series as $key => $serie) { $caption = $this->periodCaption[$key]; $dims = imageTextSize(9, 0, $caption); imageText($this->im, 9, 0, $i * ($this->seriesWidth + $this->seriesDistance) + $this->shiftXleft + $this->shiftXCaptionLeft + round($this->seriesWidth / 2) - $dims['width'] / 2, $this->sizeY + $this->shiftY + 20, $this->getColor($this->graphtheme['textcolor'], 0), $caption); $i++; } } else { $vline_count = $this->gridLinesCount; for ($i = 1; $i < $vline_count; $i++) { dashedline($this->im, $i * ($this->sizeX / $vline_count) + $this->shiftXleft + $this->shiftXCaptionLeft, $this->shiftY + $this->shiftYCaptionTop, $i * ($this->sizeX / $vline_count) + $this->shiftXleft + $this->shiftXCaptionLeft, $this->sizeY + $this->shiftY + $this->shiftYCaptionTop, $this->getColor('Gray')); } $i = 0; foreach ($this->series as $key => $serie) { $caption = $this->periodCaption[$key]; $caption = str_pad($caption, $this->maxCaption, ' ', STR_PAD_LEFT); imageText($this->im, 8, 0, $this->shiftXleft, $this->sizeY + $this->shiftY + $this->shiftYCaptionTop - ($i * ($this->seriesWidth + $this->seriesDistance) + $this->seriesDistance + round($this->seriesWidth / 2)), $this->getColor($this->graphtheme['textcolor'], 0), $caption); $i++; } } }