Class: Facet

Facet


new Facet()

adds Facet features to RectLinear
Source:

Extends

Methods


axis( [axis] [, adding])

If axis is specified, append it to axis settings and returns the instance itself. If axis is a string, it refers axis's target(x or y) and will be converted to an object. If axis is an array of objects, replaces existing axis settings. If axis is not specified, returns the current axis settings. If axis exists and adding is false, it removes the existing axis settign which has the same target of axis.
Parameters:
Name Type Argument Default Description
axis string | object | Array.<Object> <optional>
Properties
Name Type Argument Default Description
target string x target scale's name
orient string <optional>
bottom top|right|bottom|left
thickness number <optional>
18
showDomain boolean <optional>
true
showticks boolean <optional>
true
compressTicks boolean <optional>
false if is true, only first or end value of the tick shown.
showTitle boolean <optional>
true
title string <optional>
titleOrient string <optional>
top|right|bottom|left
autoTickFormat boolean <optional>
if is true, not apply dimension and measure's format.
adding boolean <optional>
true if adding is false, removes existing the axis specified target.
Inherited From:
Source:
Returns:
Type
axis | RectLinear
Example
rectLinear.axis('x') // sets X-axis on the bottom side
 .axis({target: 'y', orient: 'right', showTicks: false, title: 'Custom Axis Y'}) // sets Y-axis on the right side
rectLinear.axis('y', false) // removes existing Y-axis

axisTitle(targetAndField, title)

sets a custom title of an axis. Filters axes, returning the axis that has the same target and field whith targetAndField, then sets or remove it's title. If title is false the selected axis's custom title will be removed. Actually, .axisTitle method manipulates axisTitles.
Parameters:
Name Type Description
targetAndField string | object
Properties
Name Type Argument Description
target string
field string <optional>
title string
Inherited From:
Source:
Returns:
Type
RectLinear
Example
rectLinear.axisTitle('x', 'custom Axis X')
rectLinear.axisTitle('y.Sales', 'custom Axis Y')
rectLinear.axisTitle({target:'y', field: 'Sales'}, 'custom Axis X')
rectLinear.axisTitle('x', false);

axisTitles( [axisTitles])

set axis titles directly.
Parameters:
Name Type Argument Description
axisTitles Array.<Object> <optional>
axisTitles[].target string target scale name of the axis(x|y)
axisTitles[].title string title to show
axisTitles[].field string <optional>
target field name of the axis
Inherited From:
Source:
Returns:
Type
axisTitles | RectLinear
Example
rectLinear.axisTitles({target:'x', title: 'custom title X'});

facet( [facet])

If facet is specified, sets the facet settings and returns the instance itself. If is true, renders vertical oriented partitions. If is a string or object, it changes the orient of partitions. If is false, renders in the default way. If facet is not specified, returns the instance's current facet setting.
Parameters:
Name Type Argument Default Description
facet boolean | string | object <optional>
false (false|true|vertical|horizontal)
Properties
Name Type Argument Default Description
orient string <optional>
vertical
Source:
Returns:
Type
facet | Facet
Example
facet.facet(true) // renders vertical partitions
facet.facet('horizontal')
facet.facet({orient: 'vertical'})
facet.facet() // returns the current setting

grid( [grid])

If grid is specified, sets grid setting and returns the instance itself. If grid is true, shows grids of axes. If grid is not specified, it returns the current grid setting.
Parameters:
Name Type Argument Default Description
grid boolean <optional>
false
Inherited From:
Source:
Returns:
Type
grid | RectLinear

offset()

Inherited From:
Source: