dc.js Class: rowChart (original) (raw)
dc. rowChart
new rowChart(parent [, chartGroup])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
parent | String|node | d3.selection | |
chartGroup | String | The name of the chart group this chart instance should be placed in. Interaction with a chart will only trigger events and redraws within the chart's group. |
Mixes In:
Source:
Returns:
Type
Example
// create a row chart under #chart-container1 element using the default global chart group var chart1 = dc.rowChart('#chart-container1'); // create a row chart under #chart-container2 element using chart group A var chart2 = dc.rowChart('#chart-container2', 'chartGroupA');
Methods
elasticX( [elasticX])
Get or set the elasticity on x axis. If this attribute is set to true, then the x axis will rescale to auto-fit the data range when filtered.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
elasticX | Boolean |
Source:
Returns:
Type
Boolean|dc.rowChart
fixedBarHeight( [fixedBarHeight])
Get or set the fixed bar height. Default is [false] which will auto-scale bars. For example, if you want to fix the height for a specific number of bars (useful in TopN charts) you could fix height as follows (where count = total number of bars in your TopN and gap is your vertical gap space).
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
fixedBarHeight | Boolean|Number | false |
Source:
Returns:
Type
Boolean|Number|dc.rowChart
Example
chart.fixedBarHeight( chartheight - (count + 1) * gap / count);
gap( [gap])
Get or set the vertical gap space between rows on a particular row chart instance.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
gap | Number | 5 |
Source:
Returns:
Type
Number|dc.rowChart
labelOffsetX( [labelOffsetX])
Get or set the x offset (horizontal space to the top left corner of a row) for labels on a particular row chart.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
labelOffsetX | Number | 10 |
Source:
Returns:
Type
Number|dc.rowChart
labelOffsetY( [labelOffsety])
Get or set the y offset (vertical space to the top left corner of a row) for labels on a particular row chart.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
labelOffsety | Number | 15 |
Source:
Returns:
Type
Number|dc.rowChart
renderTitleLabel( [renderTitleLabel])
Turn on/off Title label rendering (values) using SVG style of text-anchor 'end'.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
renderTitleLabel | Boolean | false |
Source:
Returns:
Type
Boolean|dc.rowChart
titleLabelOffsetX( [titleLabelOffsetX])
Get of set the x offset (horizontal space between right edge of row and right edge or text.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
titleLabelOffsetX | Number | 2 |
Source:
Returns:
Type
Number|dc.rowChart
x( [scale])
Gets or sets the x scale. The x scale can be any d3d3.scale.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
scale | d3.scale |
Source:
See:
Returns:
Type
d3.scale|dc.rowChart
xAxis( [xAxis])
Get or sets the x axis for the row chart instance. See the d3.axisdocumention for more information.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
xAxis | d3.axis |
Source:
Returns:
Type
d3.axis|dc.rowChart
Example
// customize x axis tick format chart.xAxis().tickFormat(function (v) {return v + '%';}); // customize x axis tick values chart.xAxis().tickValues([0, 100, 200, 300]); // use a top-oriented axis. Note: position of the axis and grid lines will need to // be set manually, see https://dc-js.github.io/dc.js/examples/row-top-axis.html chart.xAxis(d3.axisTop())