Graph: ezcGraphHorizontalBarChart
[ ]
[ Gallery ]
[ ]
[ ]
[ ]
[ ]
Class: ezcGraphHorizontalBarChart
|
Class for bar charts. Can make use of an unlimited amount of datasets and will display them as bars by default. [
source]
X axis:
- Labeled axis
- Boxed axis label renderer
Y axis:
- Numeric axis
- Exact axis label renderer
1. // Create a new horizontal bar chart
2. $chart = new ezcGraphHorizontalBarChart();
3.
4. // Add data to line chart
5. $chart->data['sample dataset'] = new ezcGraphArrayDataSet(
6. array(
7. '100' => 1.2,
8. '200' => 43.2,
9. '300' => -34.14,
10. '350' => 65,
11. '400' => 123,
12. )
13. );
14.
15. // Render chart with the special designated renderer and default SVG driver
16. $chart->renderer = new ezcGraphHorizontalRenderer();
17. $chart->render( 500, 200, 'bar_chart.svg' );
Each chart consists of several chart elements which represents logical parts of the chart and can be formatted independently. The bar chart consists of:
The type of the axis may be changed and all elements can be configured by accessing them as properties of the chart:
1. $chart->legend->position = ezcGraph::RIGHT;
Parents
ezcGraphChart
|
--ezcGraphLineChart
|
--ezcGraphBarChart
|
--ezcGraphHorizontalBarChart
Properties
Inherited Member Variables
From
ezcGraphLineChart:
From
ezcGraphChart:
Method Summary
|
protected void |
renderData(
$renderer, $boundings, $innerBoundings )
Render the assigned data |
|
protected void |
setAxisValues(
)
Aggregate and calculate value boundings on axis. |
Inherited Methods
From
ezcGraphBarChart :
From
ezcGraphLineChart :
From
ezcGraphChart :
Methods
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 |
$innerBoundings |
ezcGraphBoundings |
|
Redefinition of
setAxisValues
void setAxisValues(
)
Aggregate and calculate value boundings on axis.
This function is nearly the same as in ezcGraphLineChart, but reverses the usage of keys and values for the axis.
Redefinition of
Last updated: Tue, 23 Mar 2010