-
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'});
-
brush( [brush])
-
If brush is specified, sets the brush settings and returns the instance itself. If brush is true, renders its brush. If brush is not specified, returns the instance's current brush setting.
Parameters:
Name |
Type |
Argument |
Default |
Description |
brush |
boolean
|
<optional>
|
false
|
|
- Inherited From:
-
- Source:
-
Returns:
-
Type
-
brush
|
BrushMixin
Example
brush.brush(true); //shows brush
-
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
|
|
|
- Inherited From:
-
- 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:
-
-
padding( [padding])
-
sets the padding to the same padding value. Depending on the chart type and its scale type, padding will be applied differently. If padding is not specified, returns the instance's current padding value.
Parameters:
Name |
Type |
Argument |
Default |
Description |
padding |
number
|
<optional>
|
0
|
|
- Inherited From:
-
- Source:
-
Returns:
-
Type
-
padding
|
PaddingMixin
Example
paddingMixin.padding(0.5)
paddingMixin.padding()
-
regionPadding( [regionPadding])
-
sets the regionPadding to the same padding value. Depending on the chart type and its scale type, it will be applied differently. If regionPadding is not specified, returns the instance's current regionPadding value.
Parameters:
Name |
Type |
Argument |
Default |
Description |
regionPadding |
number
|
<optional>
|
0
|
|
- Inherited From:
-
- Source:
-
Returns:
-
Type
-
regionPadding
|
PaddingMixin
Example
paddingMixin.regionPadding(0.5)
paddingMixin.regionPadding()
-
renderCanvas()
-
- Source:
-
-
stream( [stream])
-
If stream is an object or an array of objects, appends the stream to existing data. If stream is specified, during re-rendering, it will keeps the domain interval limited by
viewInterval
. When re-renders chart, should use .render(true).
If stream is not specified, returns the existing stream.
Parameters:
Name |
Type |
Argument |
Default |
Description |
stream |
object
|
Array.<Object>
|
<optional>
|
null
|
|
- Inherited From:
-
- Source:
-
Returns:
-
Type
-
zoom
|
ZoomMixin
Example
stream.stream({category:'A', sales: 100})
.render(true);
stream.stream([
{category: 'D', sales: 100},
{category: 'E', sales: 200}
]).render(true);
-
viewInterval( [unit] [, multiple])
-
If unit is number or string, limit the key domain's length or distance within the interval. If the key domain's scale is ordnial, the length of domain will be the same to unit. Also, if the scale is continous, the distance of domain will be fixed as much as unit. If unit is string, it must be a time interval. When multiple exists, it will multiply the unit.
If unit is not specified, returns the existing viewInterval.
Parameters:
Name |
Type |
Argument |
Default |
Description |
unit |
number
|
string
|
<optional>
|
null
|
|
multiple |
number
|
<optional>
|
1
|
|
- Inherited From:
-
- Source:
-
Returns:
-
Type
-
zoom
|
ZoomMixin
Example
stream.viewInterval(1000)
stream.viewInterval('month', 3)
-
zoom( [zoom])
-
If zoom is string, selects a zoom type. If zoom is true, use the normal zoom type. If zoom is not specified, renders the current zoom Setting.
Parameters:
Name |
Type |
Argument |
Default |
Description |
zoom |
boolean
|
string
|
<optional>
|
false
|
|
- Inherited From:
-
- Source:
-
Returns:
-
Type
-
zoom
|
ZoomMixin
Example
zoomMixin.zoom(true) // selects normal zoom type
zoomMixin.zoom(false) // disable the zoom feature.
zoomMixin.zoom('brush') // selects brushable zoom type.