By default, using "none symbol" in line graphs, the legend shows a square, but there are no square symbol itself. I have added it, just copying into the Graph/interfaces/renderer.php file the same as in "no symbol", in the public function drawSymbol(
)
case ezcGraph::SQUARE:
$return = $this->driver->drawPolygon(
array(
new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ),
new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ),
new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ),
new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ),
),
$color,
true
);
// Draw optional gleam
if ( $this->options->legendSymbolGleam !== false )
{
$this->driver->drawPolygon(
array(
$topLeft = new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize,
$boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize
),
new ezcGraphCoordinate(
$boundings->x1 - ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize,
$boundings->y0 + ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize
),
$bottomRight = new ezcGraphCoordinate(
$boundings->x1 - ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize,
$boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize
),
new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->x1 - $boundings->x0 ) * $this->options->legendSymbolGleamSize,
$boundings->y1 - ( $boundings->y1 - $boundings->y0 ) * $this->options->legendSymbolGleamSize
),
),
new ezcGraphLinearGradient(
$bottomRight,
$topLeft,
$color->darken( -$this->options->legendSymbolGleam ),
$color->darken( $this->options->legendSymbolGleam )
),
true
);
}
return $return;
Also we have to add to the Graph/graph.php file in the class ezcGraph the constant:
const SQUARE = 4;
Now we can use a new symbol for our line graphs. It is possible to create some DIABOLO symbols just changing the order or the boundings...