PHP 7.4.33
Preview: jpgraph_plotline.php Size: 4.26 KB
/home/godevadmin/public_html/admin/jpgraph/jpgraph_plotline.php

<?php
/*=======================================================================
 // File:  		 JPGRAPH_PLOTLINE.PHP
 // Description: PlotLine extension for JpGraph
 // Created:  	 2009-03-24
 // Ver:  		 $Id: jpgraph_plotline.php 1931 2010-03-22 15:05:48Z ljp $
 //
 // CLASS PlotLine
 // Data container class to hold properties for a static
 // line that is drawn directly in the plot area.
 // Useful to add static borders inside a plot to show for example set-values
 //
 // Copyright (c) Asial Corporation. All rights reserved.
 //========================================================================
 */

class PlotLine {
    public $scaleposition, $direction=-1;
    protected $weight=1;
    protected $color = 'black';
    private $legend='',$hidelegend=false, $legendcsimtarget='', $legendcsimalt='',$legendcsimwintarget='';
    private $iLineStyle='solid';
    public $numpoints=0; // Needed since the framework expects this property

    function __construct($aDir=HORIZONTAL,$aPos=0,$aColor='black',$aWeight=1) {
        $this->direction = $aDir;
        $this->color=$aColor;
        $this->weight=$aWeight;
        $this->scaleposition=$aPos;
    }

    function SetLegend($aLegend,$aCSIM='',$aCSIMAlt='',$aCSIMWinTarget='') {
        $this->legend = $aLegend;
        $this->legendcsimtarget = $aCSIM;
        $this->legendcsimwintarget = $aCSIMWinTarget;
        $this->legendcsimalt = $aCSIMAlt;
    }

    function HideLegend($f=true) {
        $this->hidelegend = $f;
    }

    function SetPosition($aScalePosition) {
        $this->scaleposition=$aScalePosition;
    }

    function SetDirection($aDir) {
        $this->direction = $aDir;
    }

    function SetColor($aColor) {
        $this->color=$aColor;
    }

    function SetWeight($aWeight) {
        $this->weight=$aWeight;
    }

    function SetLineStyle($aStyle) {
        $this->iLineStyle = $aStyle;
    }

    function GetCSIMAreas() {
        return '';
    }

    //---------------
    // PRIVATE METHODS

    function DoLegend($graph) {
        if( !$this->hidelegend ) $this->Legend($graph);
    }

    // Framework function the chance for each plot class to set a legend
    function Legend($aGraph) {
        if( $this->legend != '' ) {
            $dummyPlotMark = new PlotMark();
            $lineStyle = 1;
            $aGraph->legend->Add($this->legend,$this->color,$dummyPlotMark,$lineStyle,
            $this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget);
        }
    }

    function PreStrokeAdjust($aGraph) {
        // Nothing to do
    }

    // Called by framework to allow the object to draw
    // optional information in the margin area
    function StrokeMargin($aImg) {
        // Nothing to do
    }

    // Framework function to allow the object to adjust the scale
    function PrescaleSetup($aGraph) {
        // Nothing to do
    }

    function Min() {
        return array(null,null);
    }

    function Max() {
        return array(null,null);
    }

    function _Stroke($aImg,$aMinX,$aMinY,$aMaxX,$aMaxY,$aXPos,$aYPos) {
        $aImg->SetColor($this->color);
        $aImg->SetLineWeight($this->weight);
        $oldStyle = $aImg->SetLineStyle($this->iLineStyle);
        if( $this->direction == VERTICAL ) {
            $ymin_abs = $aMinY;
            $ymax_abs = $aMaxY;
            $xpos_abs = $aXPos;
            $aImg->StyleLine($xpos_abs, $ymin_abs, $xpos_abs, $ymax_abs);
        }
        elseif( $this->direction == HORIZONTAL ) {
            $xmin_abs = $aMinX;
            $xmax_abs = $aMaxX;
            $ypos_abs = $aYPos;
            $aImg->StyleLine($xmin_abs, $ypos_abs, $xmax_abs, $ypos_abs);
        }
        else {
            JpGraphError::RaiseL(25125);//(" Illegal direction for static line");
        }
        $aImg->SetLineStyle($oldStyle);
    }

    function Stroke($aImg,$aXScale,$aYScale) {
        $this->_Stroke($aImg,
            $aImg->left_margin,
            $aYScale->Translate($aYScale->GetMinVal()),
            $aImg->width-$aImg->right_margin,
            $aYScale->Translate($aYScale->GetMaxVal()),
            $aXScale->Translate($this->scaleposition),
            $aYScale->Translate($this->scaleposition)
        );
    }
}


?>

Directory Contents

Dirs: 4 × Files: 52

Name Size Perms Modified Actions
Examples DIR
- drwxrwxr-x 2023-11-07 19:59:50
Edit Download
fonts DIR
- drwxrwxr-x 2023-11-07 19:59:50
Edit Download
lang DIR
- drwxrwxr-x 2023-11-07 19:59:50
Edit Download
themes DIR
- drwxrwxr-x 2023-11-07 19:59:50
Edit Download
959.56 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
209.29 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
366.67 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
671.42 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
85.14 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
13.82 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
55.22 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
4.72 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
8.64 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
28.16 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
7.06 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
6.90 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
6.03 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
205.28 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
12.47 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
41.10 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
47.38 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
3.55 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
17.05 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
21.16 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
20.11 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
12.00 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
4.97 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
13.60 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
160.58 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
124.61 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
17.27 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
6.09 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
8.25 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
12.00 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
18.09 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
23.89 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
11.10 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
3.89 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
12.37 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
54.70 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
32.08 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
21.19 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
4.26 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
17.66 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
30.59 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
28.98 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
7.32 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
26.91 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
8.00 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
6.26 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
48.27 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
11.06 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
3.37 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
21.36 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
25.47 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download
53.76 KB lrwxrwxr-x 2023-11-07 19:59:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).