c3js-PHP
Axis Class Reference

Inherits JsonSerializable.

Public Member Functions

 JsonSerialize ()
 
 setRotated ($rotated=false)
 
 setXCategories ($categories)
 
 setXExtent ($extent)
 
 setXHeight ($height)
 
 setXLabelPosition ($const)
 
 setXLabelText ($text)
 
 setXLocaltime ($localtime=true)
 
 setXMax ($max)
 
 setXMin ($min)
 
 setXPaddingLeft ($left)
 
 setXPaddingRight ($right)
 
 setXTickCentered ($centered=false)
 
 setXTickCount ($count)
 
 setXTickCulling ($culling)
 
 setXTickCullingMax ($max=10)
 
 setXTickFit ($fit=true)
 
 setXTickFormat ($format)
 
 setXTickOuter ($outer=true)
 
 setXTickRotate ($angle=0)
 
 setXTickValues ($values)
 
 setXType ($type=self::TYPE_INDEXED)
 
 setXVisibility ($visibility=false)
 
 setY2Center ($center)
 
 setY2Default ($range)
 
 setY2Inner ($inner=false)
 
 setY2Inverted ($inverted=false)
 
 setY2LabelPosition ($const)
 
 setY2LabelText ($text)
 
 setY2Max ($max)
 
 setY2Min ($min)
 
 setY2PaddingBottom ($bottom)
 
 setY2PaddingTop ($top)
 
 setY2TickCount ($count)
 
 setY2TickFormat ($format)
 
 setY2TickOuter ($outer)
 
 setY2TickValues ($values)
 
 setY2Visibility ($visibility=false)
 
 setYCenter ($center)
 
 setYDefault ($range)
 
 setYInner ($inner=false)
 
 setYInverted ($inverted=false)
 
 setYLabelPosition ($const)
 
 setYLabelText ($text)
 
 setYMax ($max)
 
 setYMin ($min)
 
 setYPaddingBottom ($bottom)
 
 setYPaddingTop ($top)
 
 setYTickCount ($count)
 
 setYTickFit ($fit)
 
 setYTickFormat ($format)
 
 setYTickOuter ($outer)
 
 setYTickRotate ($angle)
 
 setYTickValues ($values)
 
 setYVisibility ($visibility=true)
 

Data Fields

const POSITION_H_INNER_CENTER = 'inner-center'
 
const POSITION_H_INNER_LEFT = 'inner-left'
 
const POSITION_H_INNER_RIGHT = 'inner-right'
 
const POSITION_H_OUTER_CENTER = 'outer-center'
 
const POSITION_H_OUTER_LEFT = 'outer-left'
 
const POSITION_H_OUTER_RIGHT = 'outer-right'
 
const POSITION_V_INNER_BOTTOM = 'inner-bottom'
 
const POSITION_V_INNER_MIDDLE = 'inner-middle'
 
const POSITION_V_INNER_TOP = 'inner-top'
 
const POSITION_V_OUTER_BOTTOM = 'outer-bottom'
 
const POSITION_V_OUTER_MIDDLE = 'outer-middle'
 
const POSITION_V_OUTER_TOP = 'outer-top'
 
const TYPE_CATEGORY = 'category'
 
const TYPE_INDEXED = 'indexed'
 
const TYPE_TIMESERIES = 'timeseries'
 

Member Function Documentation

JsonSerialize ( )
Returns
array
setRotated (   $rotated = false)

Switch x and y axis position

Parameters
bool$rotatedhttp://c3js.org/reference.html#axis-rotated
setXCategories (   $categories)

Set category names on category axis

Parameters
array$categorieshttp://c3js.org/reference.html#axis-x-categories
setXExtent (   $extent)

Set default extent for subchart and zoom

Parameters
array$extenthttp://c3js.org/reference.html#axis-x-extent
setXHeight (   $height)

Set height of x axis

Parameters
int$heightHeight in pixel

http://c3js.org/reference.html#axis-x-height

setXLabelPosition (   $const)

Set label text position on x axis

Parameters
POSITION_H_INNER_RIGHT | POSITION_H_INNER_CENTER | POSITION_H_INNER_LEFT | POSITION_H_OUTER_RIGHT | POSITION_H_OUTER_CENTER | POSITION_H_OUTER_LEFT | POSITION_V_INNER_TOP | POSITION_V_INNER_MIDDLE | POSITION_V_INNER_BOTTOM | POSITION_V_OUTER_TOP | POSITION_V_OUTER_MIDDLE | POSITION_V_OUTER_BOTTOM$constsetXLabelText()
setXLabelText (   $text)

Set label text on x axis

Parameters
string$textsetXLabelPosition()
setXLocaltime (   $localtime = true)

Set how to treat the timezone of x values

Parameters
bool$localtimehttp://c3js.org/reference.html#axis-x-localtime
setXMax (   $max)

Set max value of x axis range

Parameters
int$maxhttp://c3js.org/reference.html#axis-x-max
setXMin (   $min)

Set min value of x axis range

Parameters
int$minhttp://c3js.org/reference.html#axis-x-min
setXPaddingLeft (   $left)

Set left padding for x axis

Parameters
int$leftsetXPaddingRight()
setXPaddingRight (   $right)

Set right padding for x axis

Parameters
int$rightsetXPaddingLeft()
setXTickCentered (   $centered = false)

Centerise ticks on category axis.

Parameters
bool$centeredhttp://c3js.org/reference.html#axis-x-tick-centered
setXTickCount (   $count)

The number of x axis ticks to show

Parameters
int$counthttp://c3js.org/reference.html#axis-x-tick-count
setXTickCulling (   $culling)

Setting for culling ticks

Parameters
bool$cullinghttp://c3js.org/reference.html#axis-x-tick-culling
setXTickCullingMax (   $max = 10)

The number of tick texts will be adjusted to less than this value

Parameters
int$maxhttp://c3js.org/reference.html#axis-x-tick-culling-max
setXTickFit (   $fit = true)

Fit x axis ticks

Parameters
bool$fithttp://c3js.org/reference.html#axis-x-tick-fit
setXTickFormat (   $format)

A function to format tick value

Parameters
string$formatd3.format

http://c3js.org/reference.html#axis-x-tick-format

setXTickOuter (   $outer = true)

Show x axis outer tick

Parameters
bool$outerhttp://c3js.org/reference.html#axis-x-tick-outer
setXTickRotate (   $angle = 0)

Rotate x axis tick text

Parameters
int$anglehttp://c3js.org/reference.html#axis-x-tick-rotate
setXTickValues (   $values)

Set the x values of ticks manually

Parameters
array$valueshttp://c3js.org/reference.html#axis-x-tick-values
setXType (   $type = self::TYPE_INDEXED)

Set type of x axis

Parameters
string$typehttp://c3js.org/reference.html#axis-x-type
setXVisibility (   $visibility = false)

Show or hide x axis

Parameters
bool$visibilityhttp://c3js.org/reference.html#axis-x-show
setY2Center (   $center)

Set center value of y2 axis

Parameters
int$centerhttp://c3js.org/reference.html#axis-y2-center
setY2Default (   $range)

Set default range of y2 axis

Parameters
array$rangehttp://c3js.org/reference.html#axis-y2-default
setY2Inner (   $inner = false)

Show y2 axis inside of the chart

Parameters
bool$innerhttp://c3js.org/reference.html#axis-y2-inner
setY2Inverted (   $inverted = false)

Change the direction of y2 axis

Parameters
bool$invertedhttp://c3js.org/reference.html#axis-y2-inverted
setY2LabelPosition (   $const)

Set label position on y2 axis

Parameters
POSITION_H_INNER_RIGHT | POSITION_H_INNER_CENTER | POSITION_H_INNER_LEFT | POSITION_H_OUTER_RIGHT | POSITION_H_OUTER_CENTER | POSITION_H_OUTER_LEFT | POSITION_V_INNER_TOP | POSITION_V_INNER_MIDDLE | POSITION_V_INNER_BOTTOM | POSITION_V_OUTER_TOP | POSITION_V_OUTER_MIDDLE | POSITION_V_OUTER_BOTTOM$constsetY2LabelText()
setY2LabelText (   $text)

Set label on y2 axis

Parameters
string$textsetY2LabelPosition()
setY2Max (   $max)

Set max value of y2 axis

Parameters
int$maxhttp://c3js.org/reference.html#axis-y2-max
setY2Min (   $min)

Set min value of y2 axis

Parameters
int$minhttp://c3js.org/reference.html#axis-y2-min
setY2PaddingBottom (   $bottom)

Set bottom padding for y2 axis

Parameters
int$bottomhttp://c3js.org/reference.html#axis-y2-padding
See also
setY2PaddingTop()
setY2PaddingTop (   $top)

Set top padding for y2 axis

Parameters
int$tophttp://c3js.org/reference.html#axis-y2-padding
See also
setY2PaddingBottom()
setY2TickCount (   $count)

Set the number of y2 axis ticks

Parameters
int$counthttp://c3js.org/reference.html#axis-y2-tick-count
setY2TickFormat (   $format)

Set formatter for y2 axis tick text

Parameters
string$formatd3.format

http://c3js.org/reference.html#axis-y2-tick-format

setY2TickOuter (   $outer)

Show or hide outer tick

Parameters
$outerhttp://c3js.org/reference.html#axis-y2-tick-outer
setY2TickValues (   $values)

Set y2 axis tick values manually

Parameters
array$valueshttp://c3js.org/reference.html#axis-y2-tick-values
setY2Visibility (   $visibility = false)

Show or hide y2 axis

Parameters
bool$visibilityhttp://c3js.org/reference.html#axis-y2-show
setYCenter (   $center)

Set center value of y axis

Parameters
int$centerhttp://c3js.org/reference.html#axis-y-center
setYDefault (   $range)

Set default range of y axis

Parameters
array$rangehttp://c3js.org/reference.html#axis-y-default
setYInner (   $inner = false)

Show y axis inside of the chart

Parameters
bool$innerhttp://c3js.org/reference.html#axis-y-inner
setYInverted (   $inverted = false)

Change the direction of y axis

Parameters
bool$invertedhttp://c3js.org/reference.html#axis-y-inverted
setYLabelPosition (   $const)

Set label position on y axis

Parameters
POSITION_H_INNER_RIGHT | POSITION_H_INNER_CENTER | POSITION_H_INNER_LEFT | POSITION_H_OUTER_RIGHT | POSITION_H_OUTER_CENTER | POSITION_H_OUTER_LEFT | POSITION_V_INNER_TOP | POSITION_V_INNER_MIDDLE | POSITION_V_INNER_BOTTOM | POSITION_V_OUTER_TOP | POSITION_V_OUTER_MIDDLE | POSITION_V_OUTER_BOTTOM$constsetYLabelText()
setYLabelText (   $text)

Set label on y axis

Parameters
string$textsetYLabelPosition()
setYMax (   $max)

Set max value of y axis

Parameters
int$maxhttp://c3js.org/reference.html#axis-y-max
setYMin (   $min)

Set min value of y axis

Parameters
int$minhttp://c3js.org/reference.html#axis-y-min
setYPaddingBottom (   $bottom)

Set bottom padding for y axis

Parameters
int$bottomhttp://c3js.org/reference.html#axis-y-padding
See also
setYPaddingTop()
setYPaddingTop (   $top)

Set top padding for y axis

Parameters
int$tophttp://c3js.org/reference.html#axis-y-padding
See also
setYPaddingBottom()
setYTickCount (   $count)

Set the number of y axis ticks

Parameters
int$counthttp://c3js.org/reference.html#axis-y-tick-count
setYTickFit (   $fit)
Parameters
$fitUndocumented. Is this really working?
setYTickFormat (   $format)

Set formatter for y axis tick text

Parameters
string$formatd3.format

http://c3js.org/reference.html#axis-y-tick-format

setYTickOuter (   $outer)

Show or hide outer tick

Parameters
$outerhttp://c3js.org/reference.html#axis-y-tick-outer
setYTickRotate (   $angle)
Parameters
$angleUndocumented. Is this really working?
setYTickValues (   $values)

Set y axis tick values manually

Parameters
array$valueshttp://c3js.org/reference.html#axis-y-tick-values
setYVisibility (   $visibility = true)

Show or hide y axis

Parameters
bool$visibilityhttp://c3js.org/reference.html#axis-y-show

Field Documentation

const POSITION_H_INNER_CENTER = 'inner-center'
const POSITION_H_INNER_LEFT = 'inner-left'
const POSITION_H_INNER_RIGHT = 'inner-right'
const POSITION_H_OUTER_CENTER = 'outer-center'
const POSITION_H_OUTER_LEFT = 'outer-left'
const POSITION_H_OUTER_RIGHT = 'outer-right'
const POSITION_V_INNER_BOTTOM = 'inner-bottom'
const POSITION_V_INNER_MIDDLE = 'inner-middle'
const POSITION_V_INNER_TOP = 'inner-top'
const POSITION_V_OUTER_BOTTOM = 'outer-bottom'
const POSITION_V_OUTER_MIDDLE = 'outer-middle'
const POSITION_V_OUTER_TOP = 'outer-top'
const TYPE_CATEGORY = 'category'
const TYPE_INDEXED = 'indexed'
const TYPE_TIMESERIES = 'timeseries'