Chart

This class creates a ODF chart

package

Docxpresso

subpackage

Charts

Methods

Construct

__construct(array $options) 
access

public

Arguments

$options

array

magic method to string

__toString() : string
access

public

Response

string

creates styles for legends and titles

_createStyle(string $styleName, array $options) : void
access

private

Arguments

$styleName

string

$options

array

inserts the chart data into a bubble chart

_dataBubbleSeries(array $data, array $options = array()) : void
access

private

Arguments

$data

array

$options

array

inserts the chart data

_dataMultipleSeries(mixed $data, array $options = array()) : void
access

private

Arguments

$data

mixed

a XML string or an array

$options

array

inserts the chart data

_dataSingleSeries(array $data, array $options = array()) : void
access

private

Arguments

$data

array

$options

array

Generates the style for a particular data point

_generateDataPointStyle(integer $counter, array $style) : void
access

protected

Arguments

$counter

integer

$style

array

Generates the general style for a particular series

_generateSeriesStyle(string $seriesName, array $options = array()) : void
access

protected

Arguments

$seriesName

string

$options

array

Generates the transform matrix associated with a 3D rotation respèct the X,Y and Z axis

_generateTransformationMatrix(integer $rotx, integer $roty, integer $rotz) : array
access

private

Arguments

$rotx

integer

an integer angle between -90 and 90. The default is 11 for all charts but pie and donut that is -60

$roty

integer

an integer angle between -45 and 45. The default is 11 for all charts but pie and donut that is 0

$rotz

integer

an integer angle between -90 and 90. The default is 5 for all charts but pie and donut that is 0 (this is ignored if the rightAngle property is set to true)

Response

array

Generates the VRP vector depending on the chosen perpective

_generateVRP(integer $perspective) : array
access

private

Arguments

$perspective

integer

given as a percentage

Response

array

gets the chart:chart DOMNode

_getChartNode() : string
access

private

Response

string

sets the styles for the x, y and z chart grids

_grid(\Docxpresso\Core\Charts\DOMNode $node, array $options) : void
access

private

Arguments

$node

\Docxpresso\Core\Charts\DOMNode

$options

array

sets some default axis styling properties depending of the chart type

_setDefaultAxisProps(string $axis, string $type, array &$options) : void
access

private

Arguments

$axis

string

$type

string

$options

array

sets some default styling properties depending of the chart type

_setDefaultChartProps(string $type, array &$options) : void
access

private

Arguments

$type

string

$options

array

sets some default axis styling properties depending of the chart type

_setDefaultComponentProps(string $component, string $type, array &$options) : void
access

private

Arguments

$component

string

$type

string

$options

array

sets some default grid styling properties depending of the chart type

_setDefaultGridProps(string $axis, string $gridType, string $type, array &$options) : void
access

private

Arguments

$axis

string

$gridType

string

$type

string

$options

array

sets the styles for the x, y and z chart axis

axis(\Docxpresso\Core\Charts\(string) $axis,  $options = array()) : void
access

public

Arguments

$axis

\Docxpresso\Core\Charts\(string)

it may be x, y or z

$options

with the following keys and values

 'visible' => (boolean) default value is true
 'logarithmic' => (boolean) default value is false
 'font-color' => (string) hexadecimal color: #ff0000, ...
 'font-family' => (string) Arial, Calibri, ...
 'font-size' => (int) given in points
 'axis-position' => (mixed) it can be start (default), end or a
  numeric value dictating where the perpendicular axis shiould cross
 'label-arrangement' => (string) side-by-side, stagger-even or
  stagger-odd.
 'display-label' => (boolean) default value is true
 'axis-label-position' => (string) near-axis (default),
  near-axis-other-side, outside-end or outside-start
 'reverse-direction' => (boolean) default is false
 'text-overlap' => (boolean) default is false. It specifies
  whether axis labels may overlap each other
 'line-break' => (boolean) default is true. specifies whether
  word wrapping is allowed for axis labels
 'stroke' => (string) solid (default), dash or none.
 'stroke-width' => (string) given in points (default 0.75pt), cm, in.
 'stroke-color' => (string) hexadecimal color: #d9d9d9 (default)
 'stroke-opacity' => (string) percentage: 100% (default), 80%, ....
 'stroke-linejoin' => (string) round (default), bevel, middle,
  miter or none
 'stroke-linecap' => (string) butt (default), round or square.
 'tick-marks-major-inner' => (boolean) default value is false
 'tick-marks-minor-inner' => (boolean) default value is false
 'tick-marks-major-outer' => (boolean) default value is false
 'tick-marks-minor-outer' => (boolean) default value is false

sets the styles of the different chart components: wall and floor

component(string $component = 'wall',  $options = array()) : void
access

public

Arguments

$component

string

it can be wall or floor

$options

with the following keys and values

 'fill-color' => (string) hexadecimal color: #ffffff (default)
 'fill-opacity' => (string) percentage: 100% (default), 80%, ....
 'stroke' => (string) solid (default), dash or none.
 'stroke-width' => (string) given in points, cm or in.
 'stroke-color' => (string) hexadecimal color.
 'stroke-opacity' => (string) percentage: 100% (default), 80%, ....
 'stroke-linejoin' => (string) round (default), bevel, middle,
  miter or none
 'stroke-linecap' => (string) butt (default), round or square.

inserts the chart data

data(mixed $data, array $options = array()) : void
access

public

Arguments

$data

mixed

a XML string or an array

$options

array

gets the chart type

getChartType() : string
access

public

Response

string

gets the style id

getStyleId() : string
access

public

Response

string

sets the styles for the x, y and z chart grids

grid(\Docxpresso\Core\Charts\(string) $axis = 'x', \Docxpresso\Core\Charts\(string) $type = 'major',  $options = array()) : void
access

public

Arguments

$axis

\Docxpresso\Core\Charts\(string)

it may be x, y or z

$type

\Docxpresso\Core\Charts\(string)

it may be major or minor

$options

with the following keys and values

 'stroke' => (string) solid (default), dash or none.
 'stroke-width' => (string) given in points, cm or in. The defaults
  are: 0.75pt for major grids and 0.5pt for minor grids
 'stroke-color' => (string) hexadecimal color. For major grids the
  default is #d9d9d9 and #f0f0f0 for minor grids
 'stroke-opacity' => (string) percentage: 100% (default), 80%, ....
 'stroke-linejoin' => (string) round (default), bevel, middle,
  miter or none
 'stroke-linecap' => (string) butt (default), round or square.

inserts a legend into the chart

legend( $options = array()) : void
access

public

Arguments

$options

with the following keys and values

 'legend-position' => (string) left, right, top or bottom
 'color' => (string) hexadecimal value: #333333, ...
 'font-family' => (string) Arial, caliobri, ...
 'font-size => (string) (string) given in points, cm or in.
 'font-weight' => (string) bold or normal.
 'font-style' => (string) italic or normal.
 'fill-color' => (string) hexadecimal color: #ffffff (default)
 'fill-opacity' => (string) percentage: 100% (default), 80%, ....
 'stroke' => (string) solid (default), dash or none.
 'stroke-width' => (string) given in points, cm or in.
 'stroke-color' => (string) hexadecimal color. For major grids the
  default is #d9d9d9 and #b3b3b3 for minor grids
 'stroke-opacity' => (string) percentage: 100% (default), 80%, ....
 'stroke-linejoin' => (string) round (default), bevel, middle,
  miter or none
 'stroke-linecap' => (string) butt (default), round or square.
 'name' => (string) the name used for the series. It only applies to
  bubble charts

repair the chartWrapper style for correct Word rendering

repairChart4Word(\Docxpresso\Core\Charts\DOMNode $node) : void
access

public

Arguments

$node

\Docxpresso\Core\Charts\DOMNode

returns the letter corresponding to a table row (a-z aa-az ba-bz .

rowLetter(integer $j) : string
static

..)

access

public

static

Arguments

$j

integer

Response

string

sets the chart type

setChartType(string $type) : void
access

public

Arguments

$type

string

Sets the colorScheme for the chart

setColorScheme(mixed $colorScheme) : void
access

public

Arguments

$colorScheme

mixed

it can be the name of one of the predefined color schemes: default, classic, blue, red, green or an array of arrays with the following keys and values: 'fill-color' (string) an hexadecimal color #ff0000, #56a845, ... 'opacity' (string) given as a percentage 100%, 80%, 50%, ... 'stroke' (string) none, dash or solid 'stroke-width' (string) given in points, cm, in, ... 'stroke-color' (string) an hexadecimal color #ff0000, #56a845, ...

sets the style id

setStyleId(string $id) : void
access

public

Arguments

$id

string

Sets the 3D rotation angles and perspective

transform3D( $options) : void
access

public

Arguments

$options

with the following keys and values

 'rotate-x' => (int) rotation angle respect the x-axis. The default
  value is 11 for all charts but for pie or doonut charts that is -60
 'rotate-y' => (int) rotation angle respect the y-axis. The default
  value is 25 for all charts but for pie or doonut charts that is 0
 'rotate-z' => (int) rotation angle respect the z-axis. The default
  value is 5 for all charts but for pie or doonut charts that is 0
 'right-angled-axes' => (boolean) default value is true (if true
  the rotate-z option is ignored)
 'perspective' => (int) given as a percentage (default value
  is 20)

Properties

available chart types

chartTypes : array
static
var
access

public

static

Type(s)

array

default chart properties

defaultChartProperties : array
static
var
access

public

static

Type(s)

array

graphic properties

graphicPropsNS : array
static
access

public

static
var

Type(s)

array

available symbol types

symbols : array
static
var
access

public

static

Type(s)

array

text properties

textPropsNS : array
static
access

public

static
var

Type(s)

array

This is needed for chart rendering in Word

styleXML : string
static
var
access

public

static

Type(s)

string

camera matrix data

_cameraMatrix : array
var
access

private

Type(s)

array

chart

_chart : \Docxpresso\Core\Charts\DOMDocument
var
access

private

Type(s)

\Docxpresso\Core\Charts\DOMDocument

chart

_chartType : string
var
access

private

Type(s)

string

class

_class : string
var
access

private

Type(s)

string

color scheme

_colorScheme : array
var
access

private

Type(s)

array

custom properties

_customChartProperties : array
var
access

private

Type(s)

array

distance

_distance : string
var
access

private

Type(s)

string

chart DOM document

_dom : \Docxpresso\Core\Charts\DOMDocument
var
access

private

Type(s)

\Docxpresso\Core\Charts\DOMDocument

focal length

_focalLength : string
var
access

private

Type(s)

string

root element

_rootChartElement : \Docxpresso\Core\Charts\DOMNode
var
access

private

Type(s)

\Docxpresso\Core\Charts\DOMNode

style id

_styleId : string
var
access

private

Type(s)

string

styles

_styles : \Docxpresso\Core\Charts\DOMNode
var
access

private

Type(s)

\Docxpresso\Core\Charts\DOMNode

3D

_threeD : boolean
var
access

private

Type(s)

boolean

VPN

_vpn : array
var
access

private

Type(s)

array

VRP

_vrp : array
var
access

private

Type(s)

array

VUP

_vup : array
var
access

private

static

Type(s)

array

Chart XPath

_xpath : \Docxpresso\Core\Charts\DOMXPath
var
access

private

static

Type(s)

\Docxpresso\Core\Charts\DOMXPath