summaryrefslogtreecommitdiffstats
path: root/src/renderer/2d.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-08-02 14:07:19 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-08-02 14:07:19 +0000
commit97902f4d7de3482cf110950544cc4a186dd84b11 (patch)
treef2e064cc92d0f5c3645aa312b6737f556f71dfe7 /src/renderer/2d.php
parent21a3467e539669f6b8935db0668891a7507b3675 (diff)
downloadzetacomponents-graph-97902f4d7de3482cf110950544cc4a186dd84b11.zip
zetacomponents-graph-97902f4d7de3482cf110950544cc4a186dd84b11.tar.gz
- Added basic 3d renderer
# Several unresolved rendering issues - Fixed filled line charts in 2d renderer
Diffstat (limited to 'src/renderer/2d.php')
-rw-r--r--src/renderer/2d.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/renderer/2d.php b/src/renderer/2d.php
index 9880025..8e54de0 100644
--- a/src/renderer/2d.php
+++ b/src/renderer/2d.php
@@ -243,6 +243,8 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
* @param ezcGraphColor $color Color of line
* @param ezcGraphCoordinate $start Starting point
* @param ezcGraphCoordinate $end Ending point
+ * @param int $dataNumber Number of dataset
+ * @param int $dataCount Count of datasets in chart
* @param int $symbol Symbol to draw for line
* @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor
* @param ezcGraphColor $fillColor Color to fill line with
@@ -255,11 +257,13 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
ezcGraphColor $color,
ezcGraphCoordinate $start,
ezcGraphCoordinate $end,
+ $dataNumber = 1,
+ $dataCount = 1,
$symbol = ezcGraph::NO_SYMBOL,
ezcGraphColor $symbolColor = null,
ezcGraphColor $fillColor = null,
$axisPosition = 0.,
- $thickness = 1 )
+ $thickness = 1)
{
// Perhaps fill up line
if ( $fillColor !== null &&
@@ -277,19 +281,19 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
array(
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $start->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $start->y
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $start->y
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $end->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $end->y
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $end->y
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $end->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $axisPosition
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $axisPosition
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $start->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $axisPosition
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $axisPosition
),
),
$fillColor,
@@ -302,7 +306,7 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
$startDiff = abs( $axisPosition - $start->y );
$endDiff = abs( $axisPosition - $end->y );
- $cuttingPosition = $startDiff / ( $endDiff / $startDiff );
+ $cuttingPosition = $startDiff / ( $endDiff + $startDiff );
$cuttingPoint = new ezcGraphCoordinate(
$start->x + ( $end->x - $start->x ) * $cuttingPosition,
$axisPosition
@@ -312,15 +316,15 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
array(
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $start->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $axisPosition
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $axisPosition
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $start->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $start->y
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $start->y
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $cuttingPoint->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $cuttingPoint->y
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $cuttingPoint->y
),
),
$fillColor,
@@ -331,15 +335,15 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
array(
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $end->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $axisPosition
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $axisPosition
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $end->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $end->y
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $end->y
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $cuttingPoint->x,
- $boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $cuttingPoint->y
+ $boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $cuttingPoint->y
),
),
$fillColor,
OpenPOWER on IntegriCloud