From dfc4e20b8e9ca57340e24143539498fb82527697 Mon Sep 17 00:00:00 2001 From: randommonk Date: Thu, 4 Jan 2018 22:52:54 +0000 Subject: Bumped version to 4.3. Added jpgraph stats developed by killerEye --- html/jpgraph/jpgraph_plotline.php | 142 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 html/jpgraph/jpgraph_plotline.php (limited to 'html/jpgraph/jpgraph_plotline.php') diff --git a/html/jpgraph/jpgraph_plotline.php b/html/jpgraph/jpgraph_plotline.php new file mode 100644 index 0000000..4ee0f56 --- /dev/null +++ b/html/jpgraph/jpgraph_plotline.php @@ -0,0 +1,142 @@ +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) + ); + } +} + + +?> -- cgit