Graph: ezcGraphChartElementBackground
[ ]
[ Gallery ]
[ ]
[ ]
[ ]
[ ]
Class: ezcGraphChartElementBackground
|
Chart element representing the background. [
source]
Chart elements can be understood as widgets or layout container inside the chart. The actual transformation to images happens inside the renderers. They represent all elements inside the chart and contain mostly general formatting options, while the renderer itself might define additional formatting options for some chart elments. You can find more about the general formatting options for chart elements in the base class ezcGraphChartElement.
Additionally to common background and border for chart elements it can draw an image on the chart background, and optionally repeat it. The position will be used to define the start of the repetition.
The repetition effects are modelled similar to the background settings in CSS. The example shows some common settings:
1. $chart = new ezcGraphPieChart();
2. $chart->data['example'] = new ezcGraphArrayDataSet( array(
3. 'Foo' => 23,
4. 'Bar' => 42,
5. ) );
6.
7. $chart->background->image = 'background.png';
8.
9. // Image would be repeated horizontal at the top of the background
10. $chart->background->repeat = ezcGraph::HORIZONTAL;
11. $chart->background->postion = ezcGraph::TOP;
12.
13. // Image would be placed once in the center
14. $chart->background->repeat = ezcGraph::NO_REPEAT; // default;
15. $chart->background->position = ezcGraph::CENTER | ezcGraph::MIDDLE;
16.
17. // Image would be repeated all over the chart, the position is irrelevant
18. $chart->background->repeat = ezcGraph::HORIZONTAL | ezcGraph::VERTICAL;
19.
20. $graph->render( 400, 250, 'legend.svg' );
Parents
ezcBaseOptions
|
--ezcGraphChartElement
|
--ezcGraphChartElementBackground
Properties
|
string |
read/write
|
$image
Filename of the file to use for background |
|
int |
read/write
|
$repeat
Defines how the background image gets repeated |
Inherited Member Variables
From
ezcBaseOptions:
Method Summary
|
public ezcGraphBoundings |
render(
$renderer, $boundings )
Render the background |
|
public void |
setFromPalette(
$palette )
Set colors and border for this element |
Inherited Methods
From
ezcGraphChartElement :
From
ezcBaseOptions :
Methods
render
Render the background
Parameters
| Name |
Type |
Description |
$renderer |
ezcGraphRenderer |
Renderer |
$boundings |
ezcGraphBoundings |
Boundings |
Redefinition of
setFromPalette
Set colors and border for this element
Method is overwritten because we do not ant to apply the global padding and margin here.
Parameters
Redefinition of
Last updated: Mon, 09 Feb 2009