EZ-Components
@@ -0,0 +1,27 @@
|
||||
CREDITS
|
||||
=======
|
||||
|
||||
eZ Components team
|
||||
------------------
|
||||
|
||||
- Sergey Alexeev
|
||||
- Sebastian Bergmann
|
||||
- Jan Borsodi
|
||||
- Raymond Bosman
|
||||
- Frederik Holljen
|
||||
- Kore Nordmann
|
||||
- Derick Rethans
|
||||
- Vadym Savchuk
|
||||
- Tobias Schlitt
|
||||
- Alexandru Stanoi
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
- Lars Jankowski
|
||||
|
||||
* ODO Meter Charts
|
||||
|
||||
- Elger Thiele
|
||||
|
||||
* Custom highlight values in line and bar charts.
|
||||
@@ -0,0 +1,228 @@
|
||||
1.3 - Monday 16 June 2008
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- No changes.
|
||||
|
||||
|
||||
1.3rc1 - Tuesday 10 June 2008
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #12581: Wrong axis captions in bar charts with manual min/max
|
||||
values
|
||||
|
||||
|
||||
1.3beta1 - Tuesday 27 May 2008
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- No changes.
|
||||
|
||||
|
||||
1.3alpha1 - Monday 05 May 2008
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Implemented feature #10829: Get resource from driver.
|
||||
- Implemented feature #10957: Embed glyphs for exact SVG font width
|
||||
estimation.
|
||||
(Patch by Freddie Witherden)
|
||||
- Implemented feature #11979: Line width configurable per data set.
|
||||
- Implemented feature #12382: Enhance line chart to allow invisible lines.
|
||||
- Fixed issue #12483: Average dataset does not work with a single value.
|
||||
|
||||
|
||||
1.2.1 - Monday 21 January 2008
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Implemented feature #9407: Cairo driver.
|
||||
- Fixed issue #11777: Optionally independent axis font configuration.
|
||||
- Fixed issue #12254: Bad property-check for strokeLineJoin in SVG driver.
|
||||
- Fixed issue #12295: Broken automatic scaling with manually set min value,
|
||||
not divisible by major step.
|
||||
- Fixed issue #12326: Per datapoint colors not used with bar charts.
|
||||
- Fixed issue #12405: Highlightfontsize reduced when padding > 0 in highlight
|
||||
font options.
|
||||
|
||||
|
||||
1.2 - Monday 17 December 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #12238: Documentation error.
|
||||
- Fixed issue #12246: dataBorder doesn't works in 2D renderer for piecharts.
|
||||
|
||||
|
||||
1.2beta1 - Wednesday 28 November 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #12064: Gradients are not rendered correctly in Flash driver.
|
||||
- Implemented support for odometer charts. Thanks to Lars Jankowski from Oxid
|
||||
esales for the initial patch.
|
||||
|
||||
|
||||
1.2alpha1 - Monday 29 October 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #11640: Polygon size reducement fails for very thin four edged
|
||||
polygons.
|
||||
- Fixed issue #11511: Line thickness wasn't used for rendering.
|
||||
- Fixed issue #11509: Typo in line chart option.
|
||||
- Implemented feature #10978: Add support for stacked bar charts.
|
||||
- Implemented feature #11325: Allow values of 0 to be added to pie charts, to
|
||||
be included in the legend and not rendered in the actual pie.
|
||||
- Implemented feature #11247: Custom highlight values in line and bar charts.
|
||||
Thanks to Elger Thiele for the basic patch.
|
||||
- Implemented feature #10322 and #10565: Support for multiple x, y axis,
|
||||
vertical and horizontal lines in line and bar charts.
|
||||
|
||||
|
||||
1.1.1 - Monday 13 August 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #11107: Floating point inaccuracies caused missing grid in line
|
||||
chart.
|
||||
- Fixed issue #11157: Wrong display of single record with labeled axis.
|
||||
- Fixed issue #11180: Color Palette: $dataSetColor in ezcGraphPalette starts
|
||||
with index 1 and not zero in pie charts.
|
||||
- Fixed issue #11207: Missing URL property for legend, or missing legend, may
|
||||
cause PHP notice.
|
||||
- Fixed issue #11233: Path for circular arcs in SVG driver may break because
|
||||
of locale settings.
|
||||
- Fixed issue #11235: In interactive 3D bar charts circle and bullet bars are
|
||||
not linked.
|
||||
- Fixed issue #11236: Legend is not properly linked in interactive 3D line and
|
||||
bar charts.
|
||||
|
||||
|
||||
1.1 - Monday 02 July 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Documentation updates.
|
||||
|
||||
|
||||
1.1rc1 - Monday 25 June 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #10828: PHP error when overwriting renderer in extended
|
||||
ezGraphPieChart.
|
||||
- Documentation updates and fixes.
|
||||
|
||||
|
||||
1.1beta2 - Thursday 31 May 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #10741: Make ezcGraphOutOfLogithmicalBoundingsException more
|
||||
descriptive.
|
||||
- Fixed issue #10744: ExactAxisLabelRenderer shows last value at position of
|
||||
second last value if showLastValue is disabled.
|
||||
- Fixed issue #10745 (BaxedAxisLabelRenderer wrong label positions for angles:
|
||||
(135 <= $angle <= 325).
|
||||
- Fixed issue #10746: Border size reducement algorithm fails for polygones
|
||||
with edge lengths < reducement.
|
||||
- Fixed issue #10747: axisLabelRotatedRenderer accesses unitialised variables
|
||||
for Angles % 90 != .0
|
||||
- Fixed issue #10750: SVG drivers output broken with wrong LC_NUMERIC.
|
||||
- Fixed issue #10759: Unset implementation broken in array access in datasets
|
||||
and dataset properties.
|
||||
- Fixed issue #10830: Automatically shorten labels if not enough space is
|
||||
available.
|
||||
- Fixed issue #10842: Pie charts fatal error with datasets with value sum <=
|
||||
0.
|
||||
- Fixed issue #10846: Division by zero in polygon size reducement algorithm
|
||||
for edges with an angle equals 0 degree.
|
||||
- Fixed issue #10848: Missing pie segment labels in pie charts with 3d
|
||||
renderer.
|
||||
- Fixed issue #10852: Fixed radar chart documentation.
|
||||
- Fixed issue #10858: Document on how to embed the SVG graphs in an HTML
|
||||
document.
|
||||
- Fixed issue #10861: Circle sector size reducement failes for very big
|
||||
angles.
|
||||
- Fixed issue #10881: Wrong labeling with ezcGraphDateAxis.
|
||||
|
||||
|
||||
1.1beta1 - Monday 07 May 2007
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Fixed issue #9916: Not documented: ArrayDataSet also can use Iterators.
|
||||
- Fixed issue #9926: Float values with date axis result in date parsing
|
||||
exception.
|
||||
- Fixed issue #9948: Make ezcGraphPolynom documentation public.
|
||||
- Fixed issue #9950: Improved ezcGraphPolynom::__toString method for more
|
||||
exact output.
|
||||
- Fixed issue #10018: Axis scale incorrect when startDate != first day of
|
||||
month.
|
||||
- Fixed issue #10025: Wrong statement in tutorial about swf versions supported
|
||||
by ext/ming.
|
||||
- Fixed issue #10074: Use iconv instead of mbstring.
|
||||
- Fixed issue #10055: Improve chart class documentation with chart elements.
|
||||
- Fixed issue #10056: Fixed drawing order for boxes with background and
|
||||
border.
|
||||
- Fixed issue #10199: Use saveXML instead of save( 'php://output' ) to work
|
||||
around PHP bug #40429.
|
||||
- Fixed issue #10246: sprintf output modification in PHP 5.2.1.
|
||||
- Fixed issue #10275: Low label count on labeled axis, when having (prime
|
||||
number > 10) + 1 labels.
|
||||
- Fixed issue #10536: Bar side polygons are drawn at the wrong side.
|
||||
- Fixed issue #10599: Pie chart label formatting callback only accepts callback
|
||||
functions but neither static nor non static methods.
|
||||
- Fixed issue #10606: Call to undefined function imagePsLoadFont() in gd tests
|
||||
when no t1lib is available.
|
||||
- Fixed issue #10675: Arrow heads on axis too small.
|
||||
- Fixed issue #10693: ezcGraphChartElementAxis::getSteps returns minor steps
|
||||
after last major steps.
|
||||
- Implemented feature #9402: Numeric datasets.
|
||||
- Implemented feature #9404: Add support for rotated texts on axis.
|
||||
- Implemented feature #9406: Add support for radar charts.
|
||||
- Implemented feature #9511: Added helper functions to create image maps an link SVG
|
||||
images in ezcGraphTools.
|
||||
- Implemented feature #10017: Plot whole months on date axis respecting their
|
||||
different length.
|
||||
- Implemented feature #10375: Manually reduce or increase the label count on
|
||||
labeled axis.
|
||||
- Implemented feature #10470: Add support for format callback functions on all
|
||||
axis.
|
||||
|
||||
|
||||
1.0 - Monday 18 December 2006
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Renamed ezcGraphMingDriver to ezcGraphFlashDriver.
|
||||
- Renamed pie chart options percentTreshHold to percentThreshold and
|
||||
absoluteTreshHold to absoluteThreshold.
|
||||
- Added feature #9647: Added the renderToOutput() method to the drivers.
|
||||
- Fixed issue #9545: Pie chart treshhold does not work if aggregated data
|
||||
stays below treshhold.
|
||||
- Fixed issue #9549: Pie chart slices are not contiguous with the flash driver.
|
||||
- Fixed issue #9568: Division by zero warning.
|
||||
- Fixed issue #9583: Data typecasting should only be done in axis.
|
||||
- Fixed issue #9586: No data rendered with string keys on date axis.
|
||||
- Fixed issue #9588: Wrong polynoms build from data.
|
||||
- Fixed issue #9612: Element links for SVG image in the legend require you to
|
||||
click on exactly the text.
|
||||
- Fixed issue #9655: pieChartOffset and highlight do not work together in 2D
|
||||
renderer.
|
||||
- Fixed issue #9762: Structs don't inherit from ezcBaseStruct.
|
||||
- Fixed issue #9764: 3D Pie chart segment side polygon in front of circular
|
||||
arc.
|
||||
- Fixed issue #9795: Interferring bars, when bars count is higher then major
|
||||
step count.
|
||||
- Fixed issue #9823: Failing tests with PHP 5.1, because of different
|
||||
parameter handling in imagepng, and (string) not calling __toString method.
|
||||
- Fixed issue #9827: Use majorStep size for min/max estimating on numeric axis
|
||||
with only one value.
|
||||
|
||||
|
||||
1.0beta2 - Monday 20 November 2006
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Added logarithmical scaled numeric axis.
|
||||
- Added treshhold for pie charts.
|
||||
- Added custom maximum value for pie charts.
|
||||
- Added ming driver for flash output.
|
||||
- Added text shadow, background and border to font options.
|
||||
- Added gleam to 2D pie charts.
|
||||
- Added feature #9304: Possibility to format labels via callback.
|
||||
- Fixed issue #9403: Element references do not work with Gleam in SVG.
|
||||
|
||||
|
||||
1.0beta1 - Monday 25 September 2006
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Initial release of this package.
|
||||
@@ -0,0 +1 @@
|
||||
A component for creating pie charts, line graphs and other kinds of diagrams.
|
||||
|
After Width: | Height: | Size: 2.1 MiB |
@@ -0,0 +1,143 @@
|
||||
eZ component: Graph, Design
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
:Author: Kore Nordmann
|
||||
:Revision: $Revision: 3273 $
|
||||
:Date: $Date: 2006-08-15 11:42:17 +0200 (Tue, 15 Aug 2006) $
|
||||
|
||||
Design Description
|
||||
==================
|
||||
|
||||
Purpose of Graph package
|
||||
------------------------
|
||||
|
||||
The Graph package will be used to generate different chart types from a user
|
||||
defined set of data. There will be 2D and 3D presentations for each chart
|
||||
type.
|
||||
|
||||
Classes
|
||||
-------
|
||||
|
||||
ezcGraph
|
||||
Controller for the generated graphs. Offers factory methods for the other
|
||||
classes, handles and dispatches the configuration and actions to the other
|
||||
classes.
|
||||
|
||||
ezcGraphDataset
|
||||
Receives the user data, and stores the configuration for the dataset, like
|
||||
color, label, etc. How the data is stored depends on the kind of the
|
||||
dataset. The dataset will be extended for algorithms like averaging and
|
||||
polynomial interpolation in the dataset.
|
||||
|
||||
ezcGraphChart
|
||||
Abstract class, which handles the global charts options like background
|
||||
colors or images. Aggregates ezcGraphChartElement for configurable sub
|
||||
elements.
|
||||
|
||||
ezcGraphChartPie
|
||||
Extends ezcGraphChart for pie charts. Offers additional options for pie
|
||||
charts like tresh hold under which data is combined.
|
||||
|
||||
ezcGraphChartLine
|
||||
Extends ezcGraphChart for line charts. Additionally contains two objects
|
||||
to represent and configure the axes.
|
||||
|
||||
ezcGraphChartElement
|
||||
Abstract class to define the interface how to access the configuration
|
||||
directives of different chart elements like axes and legend.
|
||||
|
||||
ezcGraphChartElementLegend
|
||||
Offers configuration options for the charts legend like background color,
|
||||
position and size.
|
||||
|
||||
ezcGraphChartElementAxe
|
||||
Offers the axes configuration options like scaling, lines within the
|
||||
graph and labeling. Can do automagic scaling of the axes.
|
||||
|
||||
ezcGraphRenderer
|
||||
Abstract class which transforms the chart elements like pie segments,
|
||||
bars, texts and lines to image primitives depending on the renderer.
|
||||
|
||||
ezcGraphRenderer2D
|
||||
Creates image primitives for the chart elements considered as two
|
||||
dimensional.
|
||||
|
||||
ezcGraphRenderer3D
|
||||
Creates image primitives for the chart elements considered as three
|
||||
dimensional.
|
||||
|
||||
ezcGraphDriver
|
||||
Offers methods to draw image primitives like textboxes, arcs, rectangles,
|
||||
polygons and lines. Needs to be extended for each output format.
|
||||
|
||||
ezcGraphDriverGD
|
||||
Creates PNG images utilizing the GDlib bundled with PHP.
|
||||
|
||||
Implementation
|
||||
==============
|
||||
|
||||
ezcGraphManagager
|
||||
-----------------
|
||||
|
||||
Offers factory methods to build up the wanted graph, containing a chart of a
|
||||
selected type, a renderer and a driver. Once aggregated the manager offers an
|
||||
unified interface to configure all parts of the graph.
|
||||
|
||||
The manager can aggregate a finite count of datasets and forwards the to the
|
||||
chart. The chart builds the visual chart elements like pie segments, lines or
|
||||
bars, which are forwarded to the renderer. They are transformed to image
|
||||
primitives accoringly to the selected renderer.
|
||||
|
||||
The datasets can be configured individually by the user of the package.
|
||||
|
||||
API example
|
||||
-----------
|
||||
|
||||
The following example shows how to use the class: ::
|
||||
|
||||
<?php
|
||||
|
||||
$pie = new ezcGraphPieChart();
|
||||
$pie->options->backgroundImage = 'background.png';
|
||||
$pie->options->border->color = '#ff0000';
|
||||
$pie->title = 'Apple Pie';
|
||||
|
||||
$pie->data['humanoids'] = new ezcGraphArrayDataSet(
|
||||
array( 'monkey' => 54, 'ape' => 37, 'human' => 9 ) // adds a new data set
|
||||
);
|
||||
$pie->data['humanoids']->color['monkey'] = 'blueish'; // setting datapoint color
|
||||
$pie->data['humanoids']->highlight( 'monkey' ); // chart type dependent
|
||||
|
||||
|
||||
$line = new ezcGraphLineChart();
|
||||
$line->options->backgroundColor = 'pink';
|
||||
|
||||
$line->data['income'] = new ezcGraphArrayDataSet(
|
||||
array( 1990 => 5, 5.1, 5.4, 5.3, 6.9 )
|
||||
);
|
||||
$line->data['income']->color = 'blue';
|
||||
$line->data['income']->symbol = ezcGraph::diamond;
|
||||
|
||||
$line->data['incomeWithTax'] = new ezcGraphArrayDataSet(
|
||||
array( 1990 => 4.9, 5.0, 5.2, 5.1, 6.4 )
|
||||
);
|
||||
$line->data['incomeWithTax']->color = 'red';
|
||||
$line->data['incomeWithTax']->symbol = ezcGraph::squareWithChupi;
|
||||
|
||||
// Create a new averaging line
|
||||
$line->data['averageIncome'] = new ezcGraphAverageDatasSet( $line->data['income'] [, options] );
|
||||
|
||||
$line->renderer = new ezcGraphRenderer2D();
|
||||
$line->driver = new ezcGraphGDDriver();
|
||||
|
||||
$line->render( 500, 200, 'file.png' );
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
..
|
||||
Local Variables:
|
||||
mode: rst
|
||||
fill-column: 79
|
||||
End:
|
||||
vim: et syn=rst tw=79
|
||||
@@ -0,0 +1,167 @@
|
||||
eZ component: Graph: Interactive data points, Design
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
:Author: $Author: dr $
|
||||
:Revision: $Rev: 8393 $
|
||||
:Date: $Date: 2008-06-16 10:22:05 +0200 (Mon, 16 Jun 2008) $
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Interactive data points describe a feature in charts, that the viewer of the
|
||||
chart can interactively get more information about data, when viewing the
|
||||
chart, or moving his mouse pointer over points of interest in the chart.
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
There are two major sets of features to implement
|
||||
|
||||
Value indication
|
||||
----------------
|
||||
|
||||
The value indication means, that at the position of the mouse pointer lines
|
||||
are drawn, depeding on the chart type, to indicate the current data value at
|
||||
this poistion in the chart. In a line chart this would mean a horizontal and a
|
||||
vertical line to the axis and some coordinate information at the current
|
||||
position of the mouse pointer, while in radar chart a line to the center of
|
||||
the chart and an ellipse, indicating the value on the y axis, needs to be
|
||||
drawn.
|
||||
|
||||
To enable this an option will be added to the driver option classes for the
|
||||
drivers, which are capeable of drawing this. The value indication will be off
|
||||
by default and can be enabled like this:
|
||||
|
||||
::
|
||||
|
||||
$chart->driver->options->valueIndication = true;
|
||||
|
||||
This option will be defined in the driver classes for the drivers implementing
|
||||
the ezcGraphDriverValueIndication interface. We cannot add those options to
|
||||
ezcGraphDriverOptions, because not all drivers will support this new feature,
|
||||
and implementing an interface in the driver option class makes no sense, as no
|
||||
methods, but only properties, will be added. The configure options will be
|
||||
delegated to an option class ezcGraphDriverValueIndicationOptions to have a
|
||||
central unique place to maintain those options.
|
||||
|
||||
Driver support
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
The driver itself needs to implement a new interface which defines the methods
|
||||
required to add the interactive elements to the resulting image. The renderer
|
||||
will call those methods on the driver if it implements the interface.
|
||||
|
||||
::
|
||||
interface ezcGraphDriverValueIndication
|
||||
{
|
||||
/***
|
||||
* Add value indication for a cartesian coordinate system
|
||||
*
|
||||
* The graph data is rendered in the bounding box, the x values to
|
||||
* indicate start with $xStart up to $xEnd, and the y values start
|
||||
* with $yStart, up to $yEnd.
|
||||
*
|
||||
* http://en.wikipedia.org/wiki/Cartesian_coordinate
|
||||
*
|
||||
* @param ezcGraphBoundings $box
|
||||
* @param float $xStart
|
||||
* @param float $xEnd
|
||||
* @param float $yStart
|
||||
* @param float $yEnd
|
||||
* return void
|
||||
*/
|
||||
public function cartesianValueIndication(
|
||||
ezcGraphBoundings $box,
|
||||
$xStart,
|
||||
$xEnd,
|
||||
$yStart,
|
||||
$yEnd
|
||||
);
|
||||
|
||||
/***
|
||||
* Add value indication for a polar coordinate system
|
||||
*
|
||||
* The graph data is rendered in the bounding box, the x values to
|
||||
* indicate start with $xStart up to $xEnd, and the y values start
|
||||
* with $yStart, up to $yEnd. The middle point of the polar coordinate
|
||||
* system is always the center point of the bounding box. The zero
|
||||
* angle may be rotated, depending on the graph rotation.
|
||||
*
|
||||
* http://en.wikipedia.org/wiki/Polar_coordinate
|
||||
*
|
||||
* @param ezcGraphBoundings $box
|
||||
* @param float $xStart
|
||||
* @param float $xEnd
|
||||
* @param float $yStart
|
||||
* @param float $yEnd
|
||||
* return void
|
||||
*/
|
||||
public function polarValueIndication(
|
||||
ezcGraphBoundings $box,
|
||||
$xStart,
|
||||
$xEnd,
|
||||
$yStart,
|
||||
$yEnd
|
||||
);
|
||||
}
|
||||
|
||||
Additional data point information
|
||||
---------------------------------
|
||||
|
||||
When hovering or clicking on a data point or a legenda item, a box with
|
||||
additional information should be displayed. The box should contain text or
|
||||
user defined content.
|
||||
|
||||
The data will be associated with the data point the same way we now associate
|
||||
URLs, by an additional option, so that you can optionally add information when
|
||||
creating your chart. This will consume nearly no memory if this feature is not
|
||||
used.
|
||||
|
||||
::
|
||||
|
||||
$chart->data['data'] = new DataSet();
|
||||
$chart->data['data']->informationBox['key'] = $object;
|
||||
|
||||
You may of course set the informationBox property without specifying a special
|
||||
data set key to set it for all data points of a data set, even it may not make
|
||||
sense semantically.
|
||||
|
||||
The value defined in the informationBox property will be passed to the driver.
|
||||
The driver classes do not need to implement additional public methods for
|
||||
this, but may optionally use an extended version of the ezcGraphContext
|
||||
structure, which is already used to pass semantical context of rendered image
|
||||
primitives to the driver. This struct will be extended by the additional
|
||||
optional property $informationBox.
|
||||
|
||||
The type of $object cannot be checked before the graph is actually rendered,
|
||||
or the scripts for the data point information are created, because it
|
||||
rigorously depends on the driver, which values are accepted here.
|
||||
|
||||
- The ming driver accepts SWFMovie, SWFSprite and SWFShape objects.
|
||||
- The SVG driver accepts XML, which should be valid SVG, which we won't check
|
||||
for performance reasons.
|
||||
- The GD driver will use enhanced imagemaps with JavaScript, so it will accept
|
||||
IDs of HTML elements of the document the image will be embedded in. The
|
||||
element may contain arbitrary content and will get an absolut poistion and
|
||||
moved in front of the chart image.
|
||||
|
||||
The driver classes do not need to implement additional public methods to make
|
||||
use of the new informationBox property, but can just check the context struct,
|
||||
if it is available and render it properly then.
|
||||
|
||||
The gd driver can of course not natively support this, because bitmaps may not
|
||||
contain any active content. An additional method createInteractiveImageMap()
|
||||
will be added to the ezcGraphTools class. This may be called, or the user can
|
||||
implement the JavaScript itself, to not infere with his own scripting
|
||||
mechanisms.
|
||||
|
||||
|
||||
..
|
||||
Local Variables:
|
||||
mode: rst
|
||||
fill-column: 79
|
||||
End:
|
||||
vim: et syn=rst tw=79
|
||||
@@ -0,0 +1,97 @@
|
||||
eZ component: Graph: Multiple axis, Design
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
:Author: $Author: kn $
|
||||
:Revision: $Revision: 5847 $
|
||||
:Date: $Date: 2007-08-08 12:26:43 +0200 (Wed, 08 Aug 2007) $
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Multiple axis are used in three different cases.
|
||||
|
||||
- In stock chart, for example, they are used to show a different meaning of
|
||||
the displayed data, for example the value of a single stock option and the
|
||||
value sum of the complete company.
|
||||
|
||||
- Another case multiple axis may be used, is displaying relating data in one
|
||||
chart which has completely different scalings or units, like the used RAM
|
||||
and the load on a machine.
|
||||
|
||||
- A third case multiple axis could be used for, are named separators to
|
||||
highlight data borders in your chart. In this case the step labels should be
|
||||
at least optional.
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
From an implementation point of view the feature seperates into two different
|
||||
APIs we need to define.
|
||||
|
||||
Adding additional axis
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When adding additional axis we want to support a finite number of marker axis,
|
||||
at every possible position in the chart.
|
||||
|
||||
::
|
||||
|
||||
$marker = new ezcGraphChartElementLabeledAxis();
|
||||
$marker->position = ezcGraph::LEFT;
|
||||
$marker->chartPosition = .4;
|
||||
|
||||
$chart->additionalAxis[] = $marker;
|
||||
|
||||
The property $position is already used by ezcGraphChartElement to indicate the
|
||||
overall position and accepts bitmasks of LEFT, RIGHT, BOTTOM and TOP. For Axis
|
||||
this indicates the base point of the axis and for additional axis it will
|
||||
define wheather the new axis is an X or Y axis in the cartesian coordinate
|
||||
system of bar and line charts.
|
||||
|
||||
As the property $position is already used the property $chartPosition
|
||||
indicates the position of the axis in the charts data section. A value of 1
|
||||
will place the axis at the very end, and a value of 0 at the very beginning of
|
||||
the data.
|
||||
|
||||
In the example above ezcGraph::LEFT means that the axis is drawn from the left
|
||||
to the right, so it is an additional x axis, and the $chartPosition indicates
|
||||
the position at 40% of the chart data bounding height.
|
||||
|
||||
Adding data for additional axis
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Data may be added explicitely on one of the additional axis to use different
|
||||
scaling und units for this dataset. The axis values are received from the data
|
||||
sets when rendering the charts, so that we are able to define the usage of an
|
||||
additional axis at any point before rendering.
|
||||
|
||||
::
|
||||
|
||||
$chart->data['foo'] = new ezcGraphArrayDataSet( ... );
|
||||
$chart->data['foo']->xAxis = $marker; // See last example
|
||||
$chart->data['foo']->yAxis = $chart->yAxis; // Redundant
|
||||
|
||||
The assignement of additional axis is optional and if none was defined the
|
||||
original common chart axis will be used. You may define custom axis for one or
|
||||
both axis.
|
||||
|
||||
Special consideration
|
||||
=====================
|
||||
|
||||
You may of course define custom scaling, custom axis types and custom axis
|
||||
label rendering algorithms for each of the used axis.
|
||||
|
||||
If no data set has been assigned to a axis it will not render any labels by
|
||||
using the ezcGraphAxisNoLabelRenderer. Otherwise the assigned data will be
|
||||
used the common way to calculate some default step sizes.
|
||||
|
||||
|
||||
..
|
||||
Local Variables:
|
||||
mode: rst
|
||||
fill-column: 79
|
||||
End:
|
||||
vim: et syn=rst tw=79
|
||||
@@ -0,0 +1,75 @@
|
||||
eZ component: Graph, Requirements
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
:Author: Derick Rethans
|
||||
:Revision: $Revision: 2547 $
|
||||
:Date: $Date: 2006-04-12 11:53:25 +0200 (Wed, 12 Apr 2006) $
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The purpose of this component is to generate different kinds of diagrams from
|
||||
different kinds of data. The diagrams' appearance needs to be slick and
|
||||
customizable.
|
||||
|
||||
Requirements
|
||||
============
|
||||
The first version of the component should cover the following types of
|
||||
charts:
|
||||
|
||||
Piechart
|
||||
--------
|
||||
A diagram showing values as elements of a piechart. It should support:
|
||||
|
||||
- highlighted parts (shown as a little bit outwards of the pie)
|
||||
- setting a tresh hold under which values are combined together in an "others"
|
||||
part
|
||||
- automatic colours, but they should be able to set manually too
|
||||
- automatic legenda generation and label placement
|
||||
- 2D view, like:
|
||||
http://www.eia.doe.gov/neic/brochure/gas04/images/pie%20chart.gif
|
||||
- 3D view, like: http://www.chambersfund.org/images/piechart.jpg
|
||||
- background image and/or colours
|
||||
|
||||
Linechart
|
||||
---------
|
||||
A diagram with a variable y-axis showing values for a finite set of data
|
||||
points. The chart should be able to show different data sets, but all measured
|
||||
only in the same unit.
|
||||
|
||||
Line charts should support:
|
||||
|
||||
- automatic colours and styles, but each dataset should be able to be styled
|
||||
manually
|
||||
- automatic scaling of the x and y-axis
|
||||
- automatic legenda generation
|
||||
- automatic label placement for both x and y-axis
|
||||
- options for setting when to draw vertical and horizontal lines, and in which
|
||||
style they should be drawn
|
||||
- 2D view, like: http://www.swiftchart.com/line_ex5.jpg
|
||||
- 3D view, like: http://www.jspwiki.org/attach/LineChart/Line+Chart+3D.png
|
||||
- background image and/or colours
|
||||
|
||||
Special Considerations
|
||||
======================
|
||||
|
||||
The component should be flexible enough to allow averaging and other analysis
|
||||
methods to work on datasets and add rendered data to the resulting graph. This
|
||||
can for example be trend analysis or mean average etc.
|
||||
|
||||
Formats
|
||||
=======
|
||||
|
||||
Graphs should be rendered as PNGs in the first version, but it should be
|
||||
possible to have different renders to render to f.e. SVG or flash in later
|
||||
versions of the component.
|
||||
|
||||
|
||||
..
|
||||
Local Variables:
|
||||
mode: rst
|
||||
fill-column: 79
|
||||
End:
|
||||
vim: et syn=rst tw=79
|
||||
@@ -0,0 +1,81 @@
|
||||
eZ component: Graph: Interactive data points, Requirements
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
:Author: $Author: kn $
|
||||
:Revision: $Rev: 5711 $
|
||||
:Date: $Date: 2007-07-10 11:29:28 +0200 (Tue, 10 Jul 2007) $
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Interactive data points describe a feature in charts, that the viewer of the
|
||||
chart can interactively get more information about data, when viewing the
|
||||
chart, or moving his mouse pointer over points of interest in the chart.
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
There are two major sets of features to implement
|
||||
|
||||
Value indication
|
||||
----------------
|
||||
|
||||
The value indication means, that at the position of the mouse pointer lines
|
||||
are drawn, depeding on the chart type, to indicate the current data value at
|
||||
this poistion in the chart. In a line chart this would mean a horizontal and a
|
||||
vertical line to the axis and some coordinate information at the current
|
||||
position of the mouse pointer, while in radar chart a line to the center of
|
||||
the chart and an ellipse, indicating the value on the y axis, needs to be
|
||||
drawn.
|
||||
|
||||
SVG
|
||||
No real problem.
|
||||
|
||||
GD / Cairo / IMagick
|
||||
Not possible without large effort.
|
||||
|
||||
Flash
|
||||
No really big deal with flash and ext/ming.
|
||||
|
||||
Additional data point information
|
||||
---------------------------------
|
||||
|
||||
When hovering or clicking on a data point or a legenda ite, a box with
|
||||
additional information should be displayed. The box should contain text or
|
||||
user defined content.
|
||||
|
||||
SVG
|
||||
With only user defined inlined SVGs or Text in a box no big deal.
|
||||
|
||||
GD / Cairo / IMagick
|
||||
With a tool script generating HTML and javascript to use with the image
|
||||
map, it should be possible to use HTML and text in boxes. This is similar
|
||||
to the currently used mechanism to create image maps.
|
||||
|
||||
Flash
|
||||
Possible with user provided SWFMovies or shapes.
|
||||
|
||||
Special consideration
|
||||
=====================
|
||||
|
||||
It is impossible to implement natively more then simple text in a box for the
|
||||
additional information in highlighted data points, because this would require
|
||||
a complete redering model like HTML uses.
|
||||
|
||||
Formats
|
||||
=======
|
||||
|
||||
The integration of HTML, Flash or SVG documents should be possible, but would
|
||||
be a non driver generic mechanism. It seems not easily possible to convert
|
||||
user defined Flash, HTML and SVG to the respective other format.
|
||||
|
||||
|
||||
..
|
||||
Local Variables:
|
||||
mode: rst
|
||||
fill-column: 79
|
||||
End:
|
||||
vim: et syn=rst tw=79
|
||||
@@ -0,0 +1,60 @@
|
||||
eZ component: Graph: Multiple axis, Requirements
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
:Author: $Author: kn $
|
||||
:Revision: $Rev: 5844 $
|
||||
:Date: $Date: 2007-08-08 11:00:39 +0200 (Wed, 08 Aug 2007) $
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Multiple axis are used in three different cases.
|
||||
|
||||
- In stock chart, for example, they are used to show a different meaning of
|
||||
the displayed data, for example the value of a single stock option and the
|
||||
value sum of the complete company.
|
||||
|
||||
- Another case multiple axis may be used, is displaying relating data in one
|
||||
chart which has completely different scalings or units, like the used RAM
|
||||
and the load on a machine.
|
||||
|
||||
- A third case multiple axis could be used for, are named separators to
|
||||
highlight data borders in your chart. In this case the step labels should be
|
||||
at least optional.
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
To act as additional axis and seperators it is required, that additional axis
|
||||
can be placed at any position in the chart, especially at the very end and
|
||||
beginning of the charts data.
|
||||
|
||||
It should be possible to associate a data set with a non default axis, to
|
||||
calculate the position of its data points based on a diffenrent scaling, then
|
||||
the default one.
|
||||
|
||||
It should also be possible to add axis not depending on any data set and
|
||||
define the scaling manually. Those axis can be placed at any position in the
|
||||
chart, and if no scaling was explicitely given and no data set is associated,
|
||||
those axis will omit drawing steps or step labeling and just display a single
|
||||
line with the (optional) axis label.
|
||||
|
||||
Special consideration
|
||||
=====================
|
||||
|
||||
An API for assigning data sets to axis other then the default one will be
|
||||
defined in the design document. The calculation of the poistion of a data
|
||||
point in a chart is completely done in the chart classes, so it will be no
|
||||
problem to use another axis for this. No changes or additions in the renderers
|
||||
will be required.
|
||||
|
||||
|
||||
..
|
||||
Local Variables:
|
||||
mode: rst
|
||||
fill-column: 79
|
||||
End:
|
||||
vim: et syn=rst tw=79
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcGraphPaletteEzGreen class
|
||||
*
|
||||
* @package Graph
|
||||
* @version 1.3
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
/**
|
||||
* Light green color pallet for ezcGraph based on green eZ colors
|
||||
*
|
||||
* @package Graph
|
||||
*/
|
||||
class ezcGraphPaletteEzGreen extends ezcGraphPalette
|
||||
{
|
||||
/**
|
||||
* Axiscolor
|
||||
*
|
||||
* @var ezcGraphColor
|
||||
*/
|
||||
protected $axisColor = '#2E3436';
|
||||
|
||||
/**
|
||||
* Array with colors for datasets
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dataSetColor = array(
|
||||
'#9CAE86',
|
||||
'#87B06B',
|
||||
'#5C9A75',
|
||||
'#467A6E',
|
||||
'#4F6C57',
|
||||
);
|
||||
|
||||
/**
|
||||
* Array with symbols for datasets
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dataSetSymbol = array(
|
||||
ezcGraph::BULLET,
|
||||
);
|
||||
|
||||
/**
|
||||
* Name of font to use
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $fontName = 'sans-serif';
|
||||
|
||||
/**
|
||||
* Fontcolor
|
||||
*
|
||||
* @var ezcGraphColor
|
||||
*/
|
||||
protected $fontColor = '#2E3436';
|
||||
|
||||
/**
|
||||
* Backgroundcolor for chart
|
||||
*
|
||||
* @var ezcGraphColor
|
||||
*/
|
||||
protected $chartBackground = '#FFFFFF';
|
||||
|
||||
/**
|
||||
* Padding in elements
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $padding = 1;
|
||||
|
||||
/**
|
||||
* Margin of elements
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $margin = 0;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcGraphPaletteEzRed class
|
||||
*
|
||||
* @package Graph
|
||||
* @version 1.3
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
/**
|
||||
* Light red color pallet for ezcGraph based on red eZ colors
|
||||
*
|
||||
* @package Graph
|
||||
*/
|
||||
class ezcGraphPaletteEzRed extends ezcGraphPalette
|
||||
{
|
||||
/**
|
||||
* Axiscolor
|
||||
*
|
||||
* @var ezcGraphColor
|
||||
*/
|
||||
protected $axisColor = '#2E3436';
|
||||
|
||||
/**
|
||||
* Array with colors for datasets
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dataSetColor = array(
|
||||
'#B50D2C',
|
||||
'#C42926',
|
||||
'#C34009',
|
||||
'#CA3C04',
|
||||
'#D86300',
|
||||
);
|
||||
|
||||
/**
|
||||
* Array with symbols for datasets
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dataSetSymbol = array(
|
||||
ezcGraph::BULLET,
|
||||
);
|
||||
|
||||
/**
|
||||
* Name of font to use
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $fontName = 'sans-serif';
|
||||
|
||||
/**
|
||||
* Fontcolor
|
||||
*
|
||||
* @var ezcGraphColor
|
||||
*/
|
||||
protected $fontColor = '#2E3436';
|
||||
|
||||
/**
|
||||
* Backgroundcolor for chart
|
||||
*
|
||||
* @var ezcGraphColor
|
||||
*/
|
||||
protected $chartBackground = '#FFFFFF';
|
||||
|
||||
/**
|
||||
* Padding in elements
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $padding = 1;
|
||||
|
||||
/**
|
||||
* Margin of elements
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $margin = 0;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
require 'Base/src/base.php';
|
||||
function __autoload( $className )
|
||||
{
|
||||
ezcBase::autoload( $className );
|
||||
}
|
||||
|
||||
// Create the graph
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->palette = new ezcGraphPaletteEzBlue();
|
||||
$graph->xAxis->majorGrid = '#888888';
|
||||
$graph->yAxis->majorGrid = '#888888';
|
||||
|
||||
// Add the data and hilight norwegian data set
|
||||
$graph->data['Posts'] = new ezcGraphArrayDataSet( array(
|
||||
'May 2006' => 1164,
|
||||
'Jun 2006' => 965,
|
||||
'Jul 2006' => 1014,
|
||||
'Aug 2006' => 1269,
|
||||
'Sep 2006' => 1269,
|
||||
'Oct 2006' => 771,
|
||||
) );
|
||||
|
||||
$graph->data['per day'] = new ezcGraphArrayDataSet( array(
|
||||
'May 2006' => 38,
|
||||
'Jun 2006' => 32,
|
||||
'Jul 2006' => 33,
|
||||
'Aug 2006' => 41,
|
||||
'Sep 2006' => 34,
|
||||
'Oct 2006' => 25,
|
||||
) );
|
||||
|
||||
// Set graph title
|
||||
$graph->title = 'Forum posts in last months';
|
||||
|
||||
// Use 3d renderer, and beautify it
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
|
||||
$graph->renderer->options->barChartGleam = .5;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
|
||||
$graph->driver = new ezcGraphSvgDriver();
|
||||
|
||||
// Output the graph with std SVG driver
|
||||
$graph->render( 500, 200, 'forum_evolution.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
require 'Base/src/base.php';
|
||||
function __autoload( $className )
|
||||
{
|
||||
ezcBase::autoload( $className );
|
||||
}
|
||||
|
||||
// Require custom palette
|
||||
require dirname( __FILE__ ) . '/ez_red.php';
|
||||
|
||||
// Create the graph
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzRed();
|
||||
$graph->legend = false;
|
||||
|
||||
// Add the data and hilight norwegian data set
|
||||
$graph->data['week'] = new ezcGraphArrayDataSet( array(
|
||||
'Claudia Kosny' => 128,
|
||||
'Kristof Coomans' => 70,
|
||||
'Xavier Dutoit' => 64,
|
||||
'David Jones' => 58,
|
||||
'Lukasz Serwatka' => 45,
|
||||
'Norman Leutner' => 22,
|
||||
'Marko Zmak' => 20,
|
||||
'sangib das' => 20,
|
||||
'Nabil Alimi' => 19,
|
||||
) );
|
||||
|
||||
// Set graph title
|
||||
$graph->title = '10 most active users on forum in last month';
|
||||
|
||||
// Use 3d renderer, and beautify it
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
$graph->renderer->options->pieChartShadowSize = 12;
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
$graph->renderer->options->pieChartHeight = 16;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->pieChartOffset = 100;
|
||||
|
||||
$graph->driver = new ezcGraphSvgDriver();
|
||||
|
||||
// Output the graph with std SVG driver
|
||||
$graph->render( 500, 200, 'forum_month.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require 'Base/src/base.php';
|
||||
function __autoload( $className )
|
||||
{
|
||||
ezcBase::autoload( $className );
|
||||
}
|
||||
|
||||
// Create the graph
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzBlue();
|
||||
$graph->legend = false;
|
||||
|
||||
// Add the data and hilight norwegian data set
|
||||
$graph->data['week'] = new ezcGraphArrayDataSet( array(
|
||||
'Claudia Kosny' => 45,
|
||||
'Lukasz Serwatka' => 35,
|
||||
'Kristof Coomans' => 25,
|
||||
'David Jones' => 23,
|
||||
'Xavier Dutoit' => 20,
|
||||
'sangib das' => 14,
|
||||
'Mark Marsiglio' => 10,
|
||||
'mark hayhurst' => 10,
|
||||
'Paul Borgermans' => 10,
|
||||
'Nabil Alimi' => 9,
|
||||
) );
|
||||
|
||||
// Set graph title
|
||||
$graph->title = '10 most active users on forum in last week';
|
||||
|
||||
// Use 3d renderer, and beautify it
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
$graph->renderer->options->pieChartShadowSize = 12;
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
$graph->renderer->options->pieChartHeight = 16;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->pieChartOffset = 100;
|
||||
|
||||
$graph->driver = new ezcGraphSvgDriver();
|
||||
|
||||
// Output the graph with std SVG driver
|
||||
$graph->render( 500, 200, 'forum_weekly.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require 'Base/src/base.php';
|
||||
function __autoload( $className )
|
||||
{
|
||||
ezcBase::autoload( $className );
|
||||
}
|
||||
|
||||
// Require custom palette
|
||||
require dirname( __FILE__ ) . '/ez_green.php';
|
||||
|
||||
// Create the graph
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzGreen();
|
||||
$graph->legend = false;
|
||||
|
||||
// Add the data and hilight norwegian data set
|
||||
$graph->data['week'] = new ezcGraphArrayDataSet( array(
|
||||
'Lukasz Serwatka' => 1805,
|
||||
'Paul Forsyth' => 1491,
|
||||
'Paul Borgermans' => 1316,
|
||||
'Kristof Coomans' => 956,
|
||||
'Alex Jones' => 942 ,
|
||||
'Bard Farstad' => 941,
|
||||
'Tony Wood' => 900,
|
||||
) );
|
||||
|
||||
// Set graph title
|
||||
$graph->title = 'Alltime 10 most active users on forum';
|
||||
|
||||
// Use 3d renderer, and beautify it
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
$graph->renderer->options->pieChartShadowSize = 12;
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
$graph->renderer->options->pieChartHeight = 16;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->pieChartOffset = 100;
|
||||
|
||||
$graph->driver = new ezcGraphSvgDriver();
|
||||
|
||||
// Output the graph with std SVG driver
|
||||
$graph->render( 500, 200, 'forum_year.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
require 'Base/src/base.php';
|
||||
function __autoload( $className )
|
||||
{
|
||||
ezcBase::autoload( $className );
|
||||
}
|
||||
|
||||
// Create the graph
|
||||
$graph = new ezcGraphPieChart();
|
||||
|
||||
$graph->palette = new ezcGraphPaletteEzRed();
|
||||
|
||||
// Add the data and hilight norwegian data set
|
||||
$graph->data['articles'] = new ezcGraphArrayDataSet( array(
|
||||
'English' => 1300000,
|
||||
'Germany' => 452000,
|
||||
'Netherlands' => 217000,
|
||||
'Norway' => 70000,
|
||||
) );
|
||||
$graph->data['articles']->highlight['Germany'] = true;
|
||||
|
||||
// Set graph title
|
||||
$graph->title = 'Wikipedia articles by country';
|
||||
|
||||
// Modify pie chart label to only show amount and percent
|
||||
$graph->options->label = '%2$d (%3$.1f%%)';
|
||||
|
||||
// Use 3d renderer, and beautify it
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
|
||||
$graph->renderer->options->pieChartShadowSize = 12;
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
|
||||
$graph->renderer->options->pieChartHeight = 8;
|
||||
$graph->renderer->options->pieChartRotation = .8;
|
||||
$graph->renderer->options->pieChartOffset = 190;
|
||||
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
|
||||
// Output the graph with std SVG driver
|
||||
$graph->render( 400, 200, 'wikipedia.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
require 'Base/src/base.php';
|
||||
function __autoload( $className )
|
||||
{
|
||||
ezcBase::autoload( $className );
|
||||
}
|
||||
|
||||
// Create the graph
|
||||
$graph = new ezcGraphPieChart();
|
||||
|
||||
// Add the data and hilight norwegian data set
|
||||
$graph->data['articles'] = new ezcGraphArrayDataSet( array(
|
||||
'English' => 1300000,
|
||||
'Germany' => 452000,
|
||||
'Netherlands' => 217000,
|
||||
'Norway' => 70000,
|
||||
) );
|
||||
$graph->data['articles']->highlight['Norway'] = true;
|
||||
|
||||
// Set graph title
|
||||
$graph->title = 'Articles by country';
|
||||
|
||||
// Modify pie chart label to only show amount and percent
|
||||
$graph->options->label = '%2$d (%3$.1f%%)';
|
||||
|
||||
// Use 3d renderer, and beautify it
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
$graph->renderer->options->pieChartShadowSize = 12;
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
$graph->renderer->options->pieChartHeight = 16;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->pieChartOffset = 100;
|
||||
|
||||
// Output the graph with std SVG driver
|
||||
$graph->render( 500, 200, 'wiki_graph.svg' );
|
||||
|
||||
?>
|
||||
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 26 KiB |
@@ -0,0 +1,31 @@
|
||||
<html>
|
||||
<head><title>Image map example</title></head>
|
||||
<body>
|
||||
<map name="GraphPieChartMap">
|
||||
<area shape="poly" coords="16,29,15,30,15,31,15,32,14,33,13,34,12,35,11,35,10,35,9,36,7,35,6,35,5,35,4,34,3,33,2,32,2,31,2,30,2,29,2,27,2,26,2,25,3,24,4,23,5,22,6,22,7,22,8,22,10,22,11,22,12,22,13,23,14,24,15,25,15,26,15,27" href="http://example.org/mozilla" alt="Mozilla" />
|
||||
<area shape="poly" coords="17,22,78,22,78,36,17,36" href="http://example.org/mozilla" alt="Mozilla" />
|
||||
<area shape="poly" coords="16,47,15,48,15,49,15,50,14,51,13,52,12,53,11,53,10,53,9,54,7,53,6,53,5,53,4,52,3,51,2,50,2,49,2,48,2,47,2,45,2,44,2,43,3,42,4,41,5,40,6,40,7,40,8,40,10,40,11,40,12,40,13,41,14,42,15,43,15,44,15,45" href="http://example.org/" alt="Explorer" />
|
||||
<area shape="poly" coords="17,40,78,40,78,54,17,54" href="http://example.org/" alt="Explorer" />
|
||||
<area shape="poly" coords="16,65,15,66,15,67,15,68,14,69,13,70,12,71,11,71,10,71,9,72,7,71,6,71,5,71,4,70,3,69,2,68,2,67,2,66,2,65,2,63,2,62,2,61,3,60,4,59,5,58,6,58,7,58,8,58,10,58,11,58,12,58,13,59,14,60,15,61,15,62,15,63" href="http://example.org/" alt="Opera" />
|
||||
<area shape="poly" coords="17,58,78,58,78,72,17,72" href="http://example.org/" alt="Opera" />
|
||||
<area shape="poly" coords="16,83,15,84,15,85,15,86,14,87,13,88,12,89,11,89,10,89,9,90,7,89,6,89,5,89,4,88,3,87,2,86,2,85,2,84,2,83,2,81,2,80,2,79,3,78,4,77,5,76,6,76,7,76,8,76,10,76,11,76,12,76,13,77,14,78,15,79,15,80,15,81" href="http://example.org/" alt="Safari" />
|
||||
<area shape="poly" coords="17,76,78,76,78,90,17,90" href="http://example.org/" alt="Safari" />
|
||||
<area shape="poly" coords="16,101,15,102,15,103,15,104,14,105,13,106,12,107,11,107,10,107,9,108,7,107,6,107,5,107,4,106,3,105,2,104,2,103,2,102,2,101,2,99,2,98,2,97,3,96,4,95,5,94,6,94,7,94,8,94,10,94,11,94,12,94,13,95,14,96,15,97,15,98,15,99" href="http://example.org/" alt="Konqueror" />
|
||||
<area shape="poly" coords="17,94,78,94,78,108,17,108" href="http://example.org/" alt="Konqueror" />
|
||||
<area shape="poly" coords="240,110,312,110,310,122,307,134,302,146,295,156,286,165,276,172,264,177,252,180,240,182,227,180,215,177,204,172,193,165,184,156,177,146,172,134,169,122,168,110,169,97,172,85,177,74,178,72" href="http://example.org/mozilla" alt="Mozilla" />
|
||||
<area shape="poly" coords="80,178,206,178,206,196,80,196" href="http://example.org/mozilla" alt="Mozilla" />
|
||||
<area shape="poly" coords="240,110,178,72,185,62,194,54,205,47,216,41,228,38,241,38,253,39,265,42,277,48,287,55,295,64,302,75,303,75" href="http://example.org/" alt="Explorer" />
|
||||
<area shape="poly" coords="252,21,400,21,400,39,252,39" href="http://example.org/" alt="Explorer" />
|
||||
<area shape="poly" coords="240,110,303,75,308,87,310,94" href="http://example.org/" alt="Opera" />
|
||||
<area shape="poly" coords="326,72,400,72,400,90,326,90" href="http://example.org/" alt="Opera" />
|
||||
<area shape="poly" coords="240,110,310,94,311,103" href="http://example.org/" alt="Safari" />
|
||||
<area shape="poly" coords="331,90,400,90,400,108,331,108" href="http://example.org/" alt="Safari" />
|
||||
<area shape="poly" coords="240,110,311,103,312,109" href="http://example.org/" alt="Konqueror" />
|
||||
<area shape="poly" coords="331,108,400,108,400,126,331,126" href="http://example.org/" alt="Konqueror" />
|
||||
</map>
|
||||
<img
|
||||
src="tutorial_example_29.png"
|
||||
width="400" height="200"
|
||||
usemap="#GraphPieChartMap" />
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="450"
|
||||
height="250"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.44.1"
|
||||
version="1.0"
|
||||
sodipodi:docbase="/home/kore/devel/ezcomponents/trunk/Graph/docs"
|
||||
sodipodi:docname="template.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient16118">
|
||||
<stop
|
||||
style="stop-color:white;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop16120" />
|
||||
<stop
|
||||
style="stop-color:white;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop16122" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3647">
|
||||
<stop
|
||||
style="stop-color:#204a8f;stop-opacity:0.94117647;"
|
||||
offset="0"
|
||||
id="stop3649" />
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3651" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3647"
|
||||
id="linearGradient3653"
|
||||
x1="449.50012"
|
||||
y1="249.5"
|
||||
x2="0.49999967"
|
||||
y2="0.5000025"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.002227,0,0,1.004016,-0.501113,-0.502011)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient16118"
|
||||
id="linearGradient16116"
|
||||
x1="104.98172"
|
||||
y1="-14.882813"
|
||||
x2="104.98172"
|
||||
y2="-31.496094"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(336.4453,-2.121318)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
gridtolerance="10000"
|
||||
guidetolerance="10"
|
||||
objecttolerance="10"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="225"
|
||||
inkscape:cy="125"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
width="450px"
|
||||
height="250px"
|
||||
inkscape:window-width="1024"
|
||||
inkscape:window-height="699"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<rect
|
||||
style="opacity:1;fill:url(#linearGradient3653);fill-opacity:1;stroke:none;stroke-width:0.99999988;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect2760"
|
||||
width="450"
|
||||
height="250"
|
||||
x="0"
|
||||
y="-1.7763568e-15" />
|
||||
<rect
|
||||
style="opacity:1;fill:white;fill-opacity:0.58823532;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect1872"
|
||||
width="399"
|
||||
height="199"
|
||||
x="25.5"
|
||||
y="40.5"
|
||||
rx="0"
|
||||
ry="0" />
|
||||
<path
|
||||
style="opacity:0.5;fill:white;fill-opacity:1;stroke:none;stroke-width:0.99999988;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 50.46875 0 L 74.625 8.21875 L 0 55.5625 L 0 61.53125 L 80.75 10.3125 L 141.03125 30.84375 L 73.5 89.03125 L 0 67.75 L 0 73 L 69 92.9375 L 0 152.40625 L 0 159.03125 L 74.71875 94.625 L 157.25 118.5 L 101.0625 186.40625 L 0 161.6875 L 0 166.8125 L 97.53125 190.6875 L 48.46875 250 L 54.9375 250 L 102.9375 192 L 206.375 217.3125 L 188.28125 250 L 193.96875 250 L 211.375 218.53125 L 312.5625 243.28125 L 310.25 250 L 315.53125 250 L 317.4375 244.46875 L 340.03125 250 L 361 250 L 319.09375 239.75 L 342.53125 172.09375 L 436.0625 199.15625 L 429.6875 250 L 434.75 250 L 440.9375 200.5625 L 450 203.1875 L 450 198 L 441.5625 195.5625 L 449.0625 135.6875 L 450 136 L 450 130.71875 L 449.6875 130.625 L 450 128.125 L 450 87.71875 L 444.84375 128.96875 L 366.6875 102.34375 L 384.8125 49.96875 L 450 73.34375 L 450 68.03125 L 386.46875 45.25 L 400.8125 3.8125 L 450 23.21875 L 450 17.84375 L 404.78125 0 L 391.15625 0 L 396.15625 1.96875 L 381.75 43.5625 L 320.375 21.53125 L 332.28125 0 L 326.5625 0 L 315.59375 19.84375 L 261.4375 0.40625 L 261.78125 0 L 245.4375 0 L 253.03125 2.71875 L 213.6875 50.25 L 150.96875 28.90625 L 184.5 0 L 176.8125 0 L 145.4375 27.03125 L 86.1875 6.84375 L 96.96875 0 L 87.59375 0 L 80.0625 4.78125 L 66.03125 0 L 50.46875 0 z M 258.03125 4.53125 L 313.125 24.28125 L 285.28125 74.625 L 218.75 52 L 258.03125 4.53125 z M 317.90625 26 L 380.125 48.28125 L 361.9375 100.75 L 290.09375 76.28125 L 317.90625 26 z M 146.5625 32.71875 L 210.25 54.40625 L 160.71875 114.28125 L 79.25 90.71875 L 146.5625 32.71875 z M 215.34375 56.125 L 282.8125 79.09375 L 249.1875 139.875 L 165.96875 115.8125 L 215.34375 56.125 z M 287.625 80.75 L 360.3125 105.46875 L 339.34375 165.96875 L 254.125 141.3125 L 287.625 80.75 z M 365.03125 107.09375 L 444.21875 134.0625 L 436.6875 194.15625 L 344.15625 167.375 L 365.03125 107.09375 z M 162.5 120 L 246.71875 144.375 L 208.875 212.78125 L 106.46875 187.71875 L 162.5 120 z M 251.625 145.78125 L 337.71875 170.6875 L 314.21875 238.5625 L 213.875 214 L 251.625 145.78125 z "
|
||||
id="rect5461" />
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="36.5"
|
||||
x="29.5"
|
||||
height="199"
|
||||
width="399"
|
||||
id="rect7236"
|
||||
style="opacity:0.8;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<rect
|
||||
style="opacity:0.6;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect7238"
|
||||
width="399"
|
||||
height="199"
|
||||
x="33.5"
|
||||
y="32.5"
|
||||
rx="0"
|
||||
ry="0" />
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="28.5"
|
||||
x="37.5"
|
||||
height="199"
|
||||
width="399"
|
||||
id="rect7240"
|
||||
style="opacity:0.4;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<rect
|
||||
style="opacity:0.2;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect9014"
|
||||
width="399"
|
||||
height="199"
|
||||
x="41.5"
|
||||
y="24.5"
|
||||
rx="0"
|
||||
ry="0" />
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="20.5"
|
||||
x="45.5"
|
||||
height="199"
|
||||
width="399"
|
||||
id="rect9016"
|
||||
style="opacity:0.1;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:17.16649818px;font-style:normal;font-weight:normal;fill:white;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
|
||||
x="361.1604"
|
||||
y="20.04665"
|
||||
id="text14332"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan14334"
|
||||
x="361.1604"
|
||||
y="20.04665">ezcGraph</tspan></text>
|
||||
<text
|
||||
id="text15221"
|
||||
y="-20.574902"
|
||||
x="361.1604"
|
||||
style="font-size:17.16649818px;font-style:normal;font-weight:normal;opacity:0.67307691;fill:url(#linearGradient16116);fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
|
||||
xml:space="preserve"
|
||||
transform="scale(1,-1)"><tspan
|
||||
y="-20.574902"
|
||||
x="361.1604"
|
||||
id="tspan15223"
|
||||
sodipodi:role="line"
|
||||
style="fill:url(#linearGradient16116);fill-opacity:1">ezcGraph</tspan></text>
|
||||
<g id="ezcGraph" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
$dir = dirname( dirname( __FILE__ ) );
|
||||
$dirParts = explode( '/', $dir );
|
||||
switch ( $dirParts[count( $dirParts ) - 3] )
|
||||
{
|
||||
case 'doc': require_once 'ezc/Base/base.php'; break; // pear
|
||||
case 'trunk': require_once "$dir/../../Base/src/base.php"; break; // svn
|
||||
default: require_once "$dir/../../Base/src/base.php"; break; // bundle
|
||||
}
|
||||
|
||||
/**
|
||||
* Autoload ezc classes
|
||||
*
|
||||
* @param string $className
|
||||
*/
|
||||
function __autoload( $className )
|
||||
{
|
||||
ezcBase::autoload( $className );
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->options->fillLines = 210;
|
||||
$graph->title = 'Concurrent requests';
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->xAxis = new ezcGraphChartElementDateAxis();
|
||||
|
||||
// Add data
|
||||
$graph->data['Machine 1'] = new ezcGraphArrayDataSet( array(
|
||||
'8:00' => 3241,
|
||||
'8:13' => 934,
|
||||
'8:24' => 1201,
|
||||
'8:27' => 1752,
|
||||
'8:51' => 123,
|
||||
) );
|
||||
$graph->data['Machine 2'] = new ezcGraphArrayDataSet( array(
|
||||
'8:05' => 623,
|
||||
'8:12' => 2103,
|
||||
'8:33' => 543,
|
||||
'8:43' => 2034,
|
||||
'8:59' => 3410,
|
||||
) );
|
||||
|
||||
$graph->data['Machine 1']->symbol = ezcGraph::BULLET;
|
||||
$graph->data['Machine 2']->symbol = ezcGraph::BULLET;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_axis_datetime.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->options->fillLines = 210;
|
||||
$graph->options->font->maxFontSize = 10;
|
||||
$graph->title = 'Error level colors';
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->yAxis = new ezcGraphChartElementLabeledAxis();
|
||||
$graph->yAxis->axisLabelRenderer->showZeroValue = true;
|
||||
|
||||
$graph->yAxis->label = 'Color';
|
||||
$graph->xAxis->label = 'Error level';
|
||||
|
||||
// Add data
|
||||
$graph->data['colors'] = new ezcGraphArrayDataSet(
|
||||
array(
|
||||
'info' => 'blue',
|
||||
'notice' => 'green',
|
||||
'warning' => 'orange',
|
||||
'error' => 'red',
|
||||
'fatal' => 'red',
|
||||
)
|
||||
);
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_axis_labeled.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->title = 'Some random data';
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->xAxis = new ezcGraphChartElementNumericAxis();
|
||||
|
||||
$graph->xAxis->min = -15;
|
||||
$graph->xAxis->max = 15;
|
||||
$graph->xAxis->majorStep = 5;
|
||||
|
||||
$data = array(
|
||||
array(),
|
||||
array()
|
||||
);
|
||||
for ( $i = -10; $i <= 10; $i++ )
|
||||
{
|
||||
$data[0][$i] = mt_rand( -23, 59 );
|
||||
$data[1][$i] = mt_rand( -23, 59 );
|
||||
}
|
||||
|
||||
// Add data
|
||||
$graph->data['random blue'] = new ezcGraphArrayDataSet( $data[0] );
|
||||
$graph->data['random green'] = new ezcGraphArrayDataSet( $data[1] );
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_axis_numeric.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_bar_chart.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->palette = new ezcGraphPaletteEz();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
$graph->data['English']->symbol = ezcGraph::NO_SYMBOL;
|
||||
$graph->data['German']->symbol = ezcGraph::BULLET;
|
||||
$graph->data['Norwegian']->symbol = ezcGraph::DIAMOND;
|
||||
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->barChartGleam = .5;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_bar_chart_3d.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
$graph->data['German']->displayType = ezcGraph::LINE;
|
||||
$graph->data['German']->highlight = true;
|
||||
$graph->data['German']->highlight['Mar 2006'] = false;
|
||||
|
||||
$graph->options->fillLines = 210;
|
||||
|
||||
$graph->options->highlightSize = 12;
|
||||
|
||||
$graph->options->highlightFont->background = '#EEEEEC88';
|
||||
$graph->options->highlightFont->border = '#000000';
|
||||
$graph->options->highlightFont->borderWidth = 1;
|
||||
|
||||
// $graph->renderer = new ezcGraphRenderer2d();
|
||||
|
||||
$graph->renderer->options->barMargin = .2;
|
||||
$graph->renderer->options->barPadding = .2;
|
||||
|
||||
$graph->renderer->options->dataBorder = 0;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_bar_chart_options.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
$graph->data['German']->displayType = ezcGraph::LINE;
|
||||
|
||||
$graph->options->fillLines = 210;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_bar_line_chart.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
$graph->data['German']->displayType = ezcGraph::LINE;
|
||||
$graph->data['German']->highlight = true;
|
||||
$graph->data['German']->highlight['Mar 2006'] = false;
|
||||
|
||||
$graph->options->fillLines = 210;
|
||||
|
||||
$graph->options->highlightSize = 12;
|
||||
|
||||
$graph->options->highlightFont->background = '#EEEEEC88';
|
||||
$graph->options->highlightFont->border = '#000000';
|
||||
$graph->options->highlightFont->borderWidth = 1;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_bar_options.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzRed();
|
||||
$graph->title = 'Access statistics';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->background->image = 'ez.png';
|
||||
$graph->background->position = ezcGraph::BOTTOM | ezcGraph::RIGHT;
|
||||
$graph->background->repeat = ezcGraph::NO_REPEAT;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_chart_background.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzGreen();
|
||||
$graph->title = 'Access statistics';
|
||||
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_chart_legend.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzBlue();
|
||||
$graph->title = 'Access statistics';
|
||||
|
||||
$graph->options->font->name = 'serif';
|
||||
|
||||
$graph->title->background = '#EEEEEC';
|
||||
$graph->title->font->name = 'sans-serif';
|
||||
|
||||
$graph->options->font->maxFontSize = 8;
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_chart_title.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphRadarChart();
|
||||
$graph->palette = new ezcGraphPaletteEzBlue();
|
||||
$graph->options->fillLines = 220;
|
||||
$graph->legend->position = ezcGraph::BOTTOM;
|
||||
|
||||
$graph->rotationAxis = new ezcGraphChartElementNumericAxis();
|
||||
$graph->rotationAxis->majorStep = 2;
|
||||
$graph->rotationAxis->minorStep = .5;
|
||||
|
||||
mt_srand( 5 );
|
||||
$data = array();
|
||||
for ( $i = 0; $i <= 10; $i++ )
|
||||
{
|
||||
$data[$i] = mt_rand( -5, 5 );
|
||||
}
|
||||
$data[$i - 1] = reset( $data );
|
||||
|
||||
$graph->data['random data'] = $dataset = new ezcGraphArrayDataSet( $data );
|
||||
|
||||
$average = new ezcGraphDataSetAveragePolynom( $dataset, 4 );
|
||||
$graph->data[(string) $average->getPolynom()] = $average;
|
||||
$graph->data[(string) $average->getPolynom()]->symbol = ezcGraph::NO_SYMBOL;
|
||||
$graph->data[(string) $average->getPolynom()]->color = '#9CAE86';
|
||||
|
||||
$graph->render( 500, 250, 'tutorial_complex_radar_chart.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphOdometerChart();
|
||||
$graph->title = 'Custom odometer';
|
||||
|
||||
$graph->data['data'] = new ezcGraphArrayDataSet(
|
||||
array( 87 )
|
||||
);
|
||||
|
||||
// Set the marker color
|
||||
$graph->data['data']->color[0] = '#A0000055';
|
||||
|
||||
// Set colors for the background gradient
|
||||
$graph->options->startColor = '#2E3436';
|
||||
$graph->options->endColor = '#EEEEEC';
|
||||
|
||||
// Define a border for the odometer
|
||||
$graph->options->borderWidth = 2;
|
||||
$graph->options->borderColor = '#BABDB6';
|
||||
|
||||
// Set marker width
|
||||
$graph->options->markerWidth = 5;
|
||||
|
||||
// Set space, which the odometer may consume
|
||||
$graph->options->odometerHeight = .7;
|
||||
|
||||
// Set axis span and label
|
||||
$graph->axis->min = 0;
|
||||
$graph->axis->max = 100;
|
||||
$graph->axis->label = 'Coverage ';
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_custom_odometer_chart.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
require_once 'tutorial_custom_palette_palette.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->palette = new tutorialCustomPalette();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
$graph->data['German']->displayType = ezcGraph::LINE;
|
||||
|
||||
$graph->options->fillLines = 210;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_custom_palette.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
class tutorialCustomPalette extends ezcGraphPalette
|
||||
{
|
||||
protected $axisColor = '#000000';
|
||||
|
||||
protected $majorGridColor = '#000000BB';
|
||||
|
||||
protected $dataSetColor = array(
|
||||
'#4E9A0688',
|
||||
'#3465A4',
|
||||
'#F57900'
|
||||
);
|
||||
|
||||
protected $dataSetSymbol = array(
|
||||
ezcGraph::BULLET,
|
||||
);
|
||||
|
||||
protected $fontName = 'sans-serif';
|
||||
|
||||
protected $fontColor = '#555753';
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->title = 'Some random data';
|
||||
$graph->legend->position = ezcGraph::BOTTOM;
|
||||
|
||||
$graph->xAxis = new ezcGraphChartElementNumericAxis();
|
||||
|
||||
$data = array();
|
||||
for ( $i = 0; $i <= 10; $i++ )
|
||||
{
|
||||
$data[$i] = mt_rand( -5, 5 );
|
||||
}
|
||||
|
||||
// Add data
|
||||
$graph->data['random data'] = $dataset = new ezcGraphArrayDataSet( $data );
|
||||
|
||||
$average = new ezcGraphDataSetAveragePolynom( $dataset, 3 );
|
||||
$graph->data[(string) $average->getPolynom()] = $average;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_dataset_average.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->title = 'Sinus';
|
||||
$graph->legend->position = ezcGraph::BOTTOM;
|
||||
|
||||
$graph->xAxis = new ezcGraphChartElementNumericAxis();
|
||||
|
||||
$graph->data['sinus'] = new ezcGraphNumericDataSet(
|
||||
-360, // Start value
|
||||
360, // End value
|
||||
create_function(
|
||||
'$x',
|
||||
'return sin( deg2rad( $x ) );'
|
||||
)
|
||||
);
|
||||
|
||||
$graph->data['sinus']->resolution = 120;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_dataset_numeric.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->title = 'Access statistics';
|
||||
$graph->options->label = '%2$d (%3$.1f%%)';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
$graph->data['Access statistics']->highlight['Explorer'] = true;
|
||||
$graph->data['Access statistics']->symbol = ezcGraph::BULLET;
|
||||
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
|
||||
$graph->renderer->options->pieChartShadowSize = 5;
|
||||
$graph->renderer->options->pieChartShadowColor = ezcGraphColor::create( '#000000' );
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
$graph->renderer->options->pieChartHeight = 8;
|
||||
$graph->renderer->options->pieChartSymbolColor = '#888A8588';
|
||||
$graph->renderer->options->pieChartRotation = .8;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->legendSymbolGleamSize = .9;
|
||||
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';
|
||||
|
||||
$graph->driver = new ezcGraphCairoDriver();
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_driver_cairo.png' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->title = 'Access statistics';
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->driver = new ezcGraphFlashDriver();
|
||||
$graph->options->font = 'tutorial_font.fdb';
|
||||
|
||||
$graph->driver->options->compression = 7;
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
$graph->renderer->options->pieChartShadowSize = 10;
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
$graph->renderer->options->pieChartHeight = 16;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
|
||||
$graph->render( 400, 200, 'tutorial_driver_flash.swf' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzGreen();
|
||||
$graph->title = 'Access statistics';
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->driver = new ezcGraphGdDriver();
|
||||
$graph->options->font = 'tutorial_font.ttf';
|
||||
|
||||
// Generate a Jpeg with lower quality. The default settings result in a image
|
||||
// with better quality.
|
||||
//
|
||||
// The reduction of the supersampling to 1 will result in no anti aliasing of
|
||||
// the image. JPEG is not the optimal format for grapics, PNG is far better for
|
||||
// this kind of images.
|
||||
$graph->driver->options->supersampling = 1;
|
||||
$graph->driver->options->jpegQuality = 100;
|
||||
$graph->driver->options->imageFormat = IMG_JPEG;
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->render( 400, 200, 'tutorial_driver_gd.jpg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->background->color = '#FFFFFFFF';
|
||||
$graph->title = 'Access statistics';
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
$graph->renderer->options->pieChartShadowSize = 10;
|
||||
$graph->renderer->options->pieChartGleam = .5;
|
||||
$graph->renderer->options->dataBorder = false;
|
||||
$graph->renderer->options->pieChartHeight = 16;
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
|
||||
$graph->driver->options->templateDocument = dirname( __FILE__ ) . '/template.svg';
|
||||
$graph->driver->options->graphOffset = new ezcGraphCoordinate( 25, 40 );
|
||||
$graph->driver->options->insertIntoGroup = 'ezcGraph';
|
||||
|
||||
$graph->render( 400, 200, 'tutorial_driver_svg.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEz();
|
||||
$graph->title = 'Access statistics';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->legend->position = ezcGraph::BOTTOM;
|
||||
$graph->legend->landscapeSize = .3;
|
||||
$graph->legend->title = 'Legend';
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_legend_options.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_line_chart.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->title = 'Some random data';
|
||||
$graph->legend->position = ezcGraph::BOTTOM;
|
||||
$graph->options->fillLines = 210;
|
||||
|
||||
$graph->xAxis = new ezcGraphChartElementNumericAxis();
|
||||
|
||||
$data = array();
|
||||
for ( $i = 0; $i <= 10; $i++ )
|
||||
{
|
||||
$data[$i] = mt_rand( -5, 5 );
|
||||
}
|
||||
|
||||
// Add data
|
||||
$graph->data['random data'] = $dataset = new ezcGraphArrayDataSet( $data );
|
||||
|
||||
$average = new ezcGraphDataSetAveragePolynom( $dataset, 3 );
|
||||
$graph->data[(string) $average->getPolynom()] = $average;
|
||||
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_line_chart_3d.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
|
||||
$graph->yAxis->min = 0;
|
||||
|
||||
// Use a different axis for the norwegian dataset
|
||||
$graph->additionalAxis['norwegian'] = $nAxis = new ezcGraphChartElementNumericAxis();
|
||||
$nAxis->position = ezcGraph::BOTTOM;
|
||||
$nAxis->chartPosition = 1;
|
||||
$nAxis->min = 0;
|
||||
|
||||
$graph->data['Norwegian']->yAxis = $nAxis;
|
||||
|
||||
// Still use the marker
|
||||
$graph->additionalAxis['border'] = $marker = new ezcGraphChartElementNumericAxis();
|
||||
|
||||
$marker->position = ezcGraph::LEFT;
|
||||
$marker->chartPosition = 1 / 3;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_line_chart_additional_axis.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphLineChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
|
||||
$graph->additionalAxis['border'] = $marker = new ezcGraphChartElementNumericAxis( );
|
||||
|
||||
$marker->position = ezcGraph::LEFT;
|
||||
$marker->chartPosition = 1 / 3;
|
||||
$marker->label = 'One million!';
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_line_chart_markers.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
require_once 'tutorial_custom_palette.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphBarChart();
|
||||
$graph->palette = new tutorialCustomPalette();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
}
|
||||
$graph->data['German']->displayType = ezcGraph::LINE;
|
||||
|
||||
$graph->options->fillLines = 210;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_modified_palette.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphOdometerChart();
|
||||
$graph->title = 'Sample odometer';
|
||||
|
||||
$graph->options->font->maxFontSize = 12;
|
||||
|
||||
$graph->data['data'] = new ezcGraphArrayDataSet(
|
||||
array( 1, 3, 9 )
|
||||
);
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_odometer_chart.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->title = 'Access statistics';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
$graph->data['Access statistics']->highlight['Opera'] = true;
|
||||
|
||||
$graph->renderToOutput( 400, 150 );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzRed();
|
||||
$graph->title = 'Access statistics';
|
||||
$graph->options->label = '%2$d (%3$.1f%%)';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
$graph->data['Access statistics']->highlight['Explorer'] = true;
|
||||
|
||||
$graph->renderer = new ezcGraphRenderer3d();
|
||||
|
||||
$graph->renderer->options->moveOut = .2;
|
||||
|
||||
$graph->renderer->options->pieChartOffset = 63;
|
||||
|
||||
$graph->renderer->options->pieChartGleam = .3;
|
||||
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
|
||||
|
||||
$graph->renderer->options->pieChartShadowSize = 5;
|
||||
$graph->renderer->options->pieChartShadowColor = '#000000';
|
||||
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->legendSymbolGleamSize = .9;
|
||||
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';
|
||||
|
||||
$graph->renderer->options->pieChartSymbolColor = '#55575388';
|
||||
|
||||
$graph->renderer->options->pieChartHeight = 5;
|
||||
$graph->renderer->options->pieChartRotation = .8;
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_pie_chart_3d.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzRed();
|
||||
$graph->title = 'Access statistics';
|
||||
$graph->legend = false;
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
$graph->data['Access statistics']->highlight['Explorer'] = true;
|
||||
|
||||
// $graph->renderer = new ezcGraphRenderer2d();
|
||||
|
||||
$graph->renderer->options->moveOut = .2;
|
||||
|
||||
$graph->renderer->options->pieChartOffset = 63;
|
||||
|
||||
$graph->renderer->options->pieChartGleam = .3;
|
||||
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
|
||||
$graph->renderer->options->pieChartGleamBorder = 2;
|
||||
|
||||
$graph->renderer->options->pieChartShadowSize = 5;
|
||||
$graph->renderer->options->pieChartShadowColor = '#BABDB6';
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_pie_chart_options.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteBlack();
|
||||
$graph->title = 'Access statistics';
|
||||
$graph->options->label = '%2$d (%3$.1f%%)';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
$graph->data['Access statistics']->highlight['Explorer'] = true;
|
||||
|
||||
// $graph->renderer = new ezcGraphRenderer2d();
|
||||
|
||||
$graph->renderer->options->moveOut = .2;
|
||||
|
||||
$graph->renderer->options->pieChartOffset = 63;
|
||||
|
||||
$graph->renderer->options->pieChartGleam = .3;
|
||||
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
|
||||
$graph->renderer->options->pieChartGleamBorder = 2;
|
||||
|
||||
$graph->renderer->options->pieChartShadowSize = 3;
|
||||
$graph->renderer->options->pieChartShadowColor = '#000000';
|
||||
|
||||
$graph->renderer->options->legendSymbolGleam = .5;
|
||||
$graph->renderer->options->legendSymbolGleamSize = .9;
|
||||
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';
|
||||
|
||||
$graph->renderer->options->pieChartSymbolColor = '#BABDB688';
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_pie_chart_pimped.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->title = 'Elections 2005 Germany';
|
||||
|
||||
$graph->data['2005'] = new ezcGraphArrayDataSet( array(
|
||||
'CDU' => 35.2,
|
||||
'SPD' => 34.2,
|
||||
'FDP' => 9.8,
|
||||
'Die Gruenen' => 8.1,
|
||||
'PDS' => 8.7,
|
||||
'NDP' => 1.6,
|
||||
'REP' => 0.6,
|
||||
) );
|
||||
|
||||
$graph->options->label = '%3$.1f%%';
|
||||
$graph->options->sum = 100;
|
||||
$graph->options->percentThreshold = 0.02;
|
||||
$graph->options->summarizeCaption = 'Others';
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_pie_options.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
$wikidata = include 'tutorial_wikipedia_data.php';
|
||||
|
||||
$graph = new ezcGraphRadarChart();
|
||||
$graph->title = 'Wikipedia articles';
|
||||
$graph->options->fillLines = 220;
|
||||
|
||||
// Add data
|
||||
foreach ( $wikidata as $language => $data )
|
||||
{
|
||||
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
|
||||
$graph->data[$language][] = reset( $data );
|
||||
}
|
||||
|
||||
$graph->render( 400, 150, 'tutorial_radar_chart.svg' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEzGreen();
|
||||
$graph->title = 'Access statistics';
|
||||
|
||||
$graph->driver = new ezcGraphGdDriver();
|
||||
$graph->options->font = 'tutorial_font.ttf';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->data['Access statistics']->url = 'http://example.org/';
|
||||
$graph->data['Access statistics']->url['Mozilla'] = 'http://example.org/mozilla';
|
||||
|
||||
$graph->render( 400, 200, 'tutorial_reference_gd.png' );
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head><title>Image map example</title></head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
echo ezcGraphTools::createImageMap( $graph, 'GraphPieChartMap' );
|
||||
|
||||
?>
|
||||
<img
|
||||
src="tutorial_reference_gd.png"
|
||||
width="400" height="200"
|
||||
usemap="#GraphPieChartMap" />
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once 'tutorial_autoload.php';
|
||||
|
||||
$graph = new ezcGraphPieChart();
|
||||
$graph->palette = new ezcGraphPaletteEz();
|
||||
$graph->title = 'Access statistics';
|
||||
|
||||
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
|
||||
'Mozilla' => 19113,
|
||||
'Explorer' => 10917,
|
||||
'Opera' => 1464,
|
||||
'Safari' => 652,
|
||||
'Konqueror' => 474,
|
||||
) );
|
||||
|
||||
$graph->data['Access statistics']->url = 'http://example.org/';
|
||||
$graph->data['Access statistics']->url['Mozilla'] = 'http://example.org/mozilla';
|
||||
|
||||
$graph->render( 400, 200, 'tutorial_reference_svg.svg' );
|
||||
|
||||
$graph->driver->options->linkCursor = 'crosshair';
|
||||
ezcGraphTools::linkSvgElements( $graph );
|
||||
|
||||
?>
|
||||