MCPcopy
hub / github.com/dc-js/dc.js / stack

Method stack

src/base/stack-mixin.js:103–122  ·  view source on GitHub ↗

* Stack a new crossfilter group onto this chart with an optional custom value accessor. All stacks * in the same chart will share the same key accessor and therefore the same set of keys. * * For example, in a stacked bar chart, the bars of each stack will be positioned using the same

(group, name, accessor)

Source from the content-addressed store, hash-verified

101 * @returns {Array<{group: crossfilter.group, name: String, accessor: Function}>|StackMixin}
102 */
103 stack (group, name, accessor) {
104 if (!arguments.length) {
105 return this._stack;
106 }
107
108 if (arguments.length <= 2) {
109 accessor = name;
110 }
111
112 const layer = {group: group};
113 if (typeof name === 'string') {
114 layer.name = name;
115 }
116 if (typeof accessor === 'function') {
117 layer.accessor = accessor;
118 }
119 this._stack.push(layer);
120
121 return this;
122 }
123
124 group (g, n, f) {
125 if (!arguments.length) {

Callers 9

groupMethod · 0.95
stock.jsFile · 0.80
legend-spec.jsFile · 0.80
line-chart-spec.jsFile · 0.80
lineLabelCountFunction · 0.80
bar-chart-spec.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected