<commit_before>=====================
eZ Components - Graph
=====================

.. contents:: Table of Contents
   :depth: 2

Introduction
============

The Graph component enables you to create line, pie and bar charts. The
output driver mechanism allows you to create different image types from each
chart, and the available renderers make the chart output customizable from
simple two-dimensional charts to beautiful three-dimensional data
projections. 

ezcGraph separates different parts of the graph into chart elements, each
representing one part of a graph. Elements include the title, the legend or an
axis, and are all independently configurable. This design not only allows you to use
different colors or fonts for each chart element, but also to define their
position and size. The main chart elements are the same for all chart types.
To define overall layouts for graphs, you can use palettes,
which specify default colors, symbols, fonts and spacings.

Data is provided through ezcGraphDataSet objects, which are normally created
from simple arrays. You also can perform statistical operations on data, as you
will see later.

Class overview
==============

This section gives you an overview of the most important classes.

ezcGraphChart
  Line, bar and pie charts extend this abstract class, which represents the
  chart to be rendered. ezcGraphChart collects the data and chart elements,
  gives you access to all configuration settings and calls the driver and
  renderer for creating the final output.

ezcGraphDataSet
  All datasets extend this abstract class to provide the data in a general
  form accessible by the chart.

ezcGraphChartElement
  All chart elements store configuration values that define their layout. An
  element's layout definition contains background, border, margin, padding and
  font configuration. ezcGraphChartElement is extended by other classes for the
  legend, text, background and different axis types.

ezcGraphChartElementAxis
  This class extends ezcGraphChartElement and is the base class for all axes.
  There are different axis types for different data to be displayed, such as
  numeric axis, string labeled axis or date axis.

ezcGraphAxisLabelRenderer
  This class defines the rendering algorithm for labels and grids on an axis.
  The distinction between algorithms is necessary, because bar charts have
  labels placed directly below the data point, but numerical data in line
  charts should be placed next to the grid.

ezcGraphPalette
  ezcGraphPalette contains color, font, symbol and spacing definitions to be
  applied to the entire graph.

ezcGraphRenderer
  This renderer transforms chart primitives, like pie chart segments, legend
  or data lines, to image primitives. You have the choice between a two- and
  three-dimensional renderer.

ezcGraphDriver
  This driver renders image primitives to an image. The default driver
  will output as SVG, but you can also render JPEGs or PNGs using ext/gd.

Chart types
===========

Pie charts
----------

The following is a simple example of how to create a pie chart using the
default driver, palette and renderer.

.. include:: tutorial/tutorial_simple_pie.php
   :literal:

Simply create a new chart object, optionally set a title for the chart,
assign the data and render it. To assign data, the dataset container
is accessed like an array to define an identifier for the dataset. The
dataset in this example is created from an array, where the keys are used as
the identifiers for the data points.

Pie charts accept only one dataset, and the data point identifiers are used to
create the legend. To generate the output, the default SVG renderer is used
with the default 2D renderer. By default, the colors are applied from the Tango
palette, from the Tango Desktop Project: http://tango.freedesktop.org/Tango_Desktop_Project

Several dataset and data point presentation styles will be mentioned in this
tutorial. One possibility is to highlight a special dataset or point. In line
15, the data point Opera is highlighted; in the case of pie charts, this
segment is pulled away from the center. See the renderer options class
ezcGraphRendererOptions for more details.

.. image:: img/tutorial_simple_pie.svg.png
   :alt:   Sample pie chart 

Pie chart options
~~~~~~~~~~~~~~~~~

There are several pie chart specific configuration options available. In
eZ Components, options are always accessed via public properties. For a full
list of all available options, see the documentation for the
ezcGraphPieChartOption class.<commit_msg>- Fixed issue #11334: Typo in option class<commit_after>=====================
eZ Components - Graph
=====================

.. contents:: Table of Contents
   :depth: 2

Introduction
============

The Graph component enables you to create line, pie and bar charts. The
output driver mechanism allows you to create different image types from each
chart, and the available renderers make the chart output customizable from
simple two-dimensional charts to beautiful three-dimensional data
projections. 

ezcGraph separates different parts of the graph into chart elements, each
representing one part of a graph. Elements include the title, the legend or an
axis, and are all independently configurable. This design not only allows you to use
different colors or fonts for each chart element, but also to define their
position and size. The main chart elements are the same for all chart types.
To define overall layouts for graphs, you can use palettes,
which specify default colors, symbols, fonts and spacings.

Data is provided through ezcGraphDataSet objects, which are normally created
from simple arrays. You also can perform statistical operations on data, as you
will see later.

Class overview
==============

This section gives you an overview of the most important classes.

ezcGraphChart
  Line, bar and pie charts extend this abstract class, which represents the
  chart to be rendered. ezcGraphChart collects the data and chart elements,
  gives you access to all configuration settings and calls the driver and
  renderer for creating the final output.

ezcGraphDataSet
  All datasets extend this abstract class to provide the data in a general
  form accessible by the chart.

ezcGraphChartElement
  All chart elements store configuration values that define their layout. An
  element's layout definition contains background, border, margin, padding and
  font configuration. ezcGraphChartElement is extended by other classes for the
  legend, text, background and different axis types.

ezcGraphChartElementAxis
  This class extends ezcGraphChartElement and is the base class for all axes.
  There are different axis types for different data to be displayed, such as
  numeric axis, string labeled axis or date axis.

ezcGraphAxisLabelRenderer
  This class defines the rendering algorithm for labels and grids on an axis.
  The distinction between algorithms is necessary, because bar charts have
  labels placed directly below the data point, but numerical data in line
  charts should be placed next to the grid.

ezcGraphPalette
  ezcGraphPalette contains color, font, symbol and spacing definitions to be
  applied to the entire graph.

ezcGraphRenderer
  This renderer transforms chart primitives, like pie chart segments, legend
  or data lines, to image primitives. You have the choice between a two- and
  three-dimensional renderer.

ezcGraphDriver
  This driver renders image primitives to an image. The default driver
  will output as SVG, but you can also render JPEGs or PNGs using ext/gd.

Chart types
===========

Pie charts
----------

The following is a simple example of how to create a pie chart using the
default driver, palette and renderer.

.. include:: tutorial/tutorial_simple_pie.php
   :literal:

Simply create a new chart object, optionally set a title for the chart,
assign the data and render it. To assign data, the dataset container
is accessed like an array to define an identifier for the dataset. The
dataset in this example is created from an array, where the keys are used as
the identifiers for the data points.

Pie charts accept only one dataset, and the data point identifiers are used to
create the legend. To generate the output, the default SVG renderer is used
with the default 2D renderer. By default, the colors are applied from the Tango
palette, from the Tango Desktop Project: http://tango.freedesktop.org/Tango_Desktop_Project

Several dataset and data point presentation styles will be mentioned in this
tutorial. One possibility is to highlight a special dataset or point. In line
15, the data point Opera is highlighted; in the case of pie charts, this
segment is pulled away from the center. See the renderer options class
ezcGraphRendererOptions for more details.

.. image:: img/tutorial_simple_pie.svg.png
   :alt:   Sample pie chart 

Pie chart options
~~~~~~~~~~~~~~~~~

There are several pie chart specific configuration options available. In
eZ Components, options are always accessed via public properties. For a full
list of all available options, see the documentation for the
ezcGraphPieChartOptions class.
{'fraction_non_alphanumeric': 0.050207831984248524, 'fraction_numerical': 0.0014220083132793699, 'mean_word_length': 4.5378558449424595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3662205', 'n_tokens_mistral': 2209, 'n_tokens_neox': 2115, 'n_words': 1318}