Graph: ezcGraphOdometerChart
[ ]
[ Gallery ]
[ ]
[ ]
[ ]
[ ]
Class: ezcGraphOdometerChart
|
Class for odometer charts. Can only use one dataset which will be dispalyed as a odometer chart. [
source]
1. $graph = new ezcGraphOdometerChart();
2. $graph->title = 'Custom odometer';
3.
4. $graph->data['data'] = new ezcGraphArrayDataSet(
5. array( 87 )
6. );
7.
8. // Set the marker color
9. $graph->data['data']->color[0] = '#A0000055';
10.
11. // Set colors for the background gradient
12. $graph->options->startColor = '#2E3436';
13. $graph->options->endColor = '#EEEEEC';
14.
15. // Define a border for the odometer
16. $graph->options->borderWidth = 2;
17. $graph->options->borderColor = '#BABDB6';
18.
19. // Set marker width
20. $graph->options->markerWidth = 5;
21.
22. // Set space, which the odometer may consume
23. $graph->options->odometerHeight = .7;
24.
25. // Set axis span and label
26. $graph->axis->min = 0;
27. $graph->axis->max = 100;
28. $graph->axis->label = 'Coverage ';
29.
30. $graph->render( 400, 150, 'custom_odometer_chart.svg' );
Each chart consists of several chart elements which represents logical parts of the chart and can be formatted independently. The odometer chart consists of:
All elements can be configured by accessing them as properties of the chart:
1. $chart->title->position = ezcGraph::BOTTOM;
Parents
ezcGraphChart
|
--ezcGraphOdometerChart
Properties
Inherited Member Variables
From
ezcGraphChart:
Method Summary
|
public int |
getDefaultDisplayType(
)
Returns the default display type of the current chart type. |
|
public void |
render(
$width, $height, [$file = null] )
Render the pie chart |
|
protected void |
renderData(
$renderer, $boundings )
Render the assigned data |
|
protected void |
renderElements(
$width, $height )
Renders the basic elements of this chart type |
|
public void |
renderToOutput(
$width, $height )
Renders this chart to direct output |
Inherited Methods
From
ezcGraphChart :
Methods
getDefaultDisplayType
int getDefaultDisplayType(
)
Returns the default display type of the current chart type.
Redefinition of
render
void render(
int
$width, int
$height, [string
$file = null] )
Render the pie chart
Renders the chart into a file or stream. The width and height are needed to specify the dimensions of the resulting image. For direct output use 'php://stdout' as output file.
Parameters
| Name |
Type |
Description |
$width |
int |
Image width |
$height |
int |
Image height |
$file |
string |
Output file |
Redefinition of
renderData
Render the assigned data
Will renderer all charts data in the remaining boundings after drawing all other chart elements. The data will be rendered depending on the settings in the dataset.
Parameters
| Name |
Type |
Description |
$renderer |
ezcGraphRenderer |
Renderer |
$boundings |
ezcGraphBoundings |
Remaining boundings |
renderElements
void renderElements(
int
$width, int
$height )
Renders the basic elements of this chart type
Parameters
| Name |
Type |
Description |
$width |
int |
|
$height |
int |
|
renderToOutput
void renderToOutput(
int
$width, int
$height )
Renders this chart to direct output
Does the same as ezcGraphChart::render(), but renders directly to output and not into a file.
Parameters
| Name |
Type |
Description |
$width |
int |
|
$height |
int |
|
Redefinition of
Last updated: Tue, 23 Mar 2010