* Create a Composite Chart. * @example * // create a composite chart under #chart-container1 element using the default global chart group * var compositeChart1 = new CompositeChart('#chart-container1'); * // create a composite chart under #chart-container2 element using chart gro
(parent, chartGroup)
| 29 | * Interaction with a chart will only trigger events and redraws within the chart's group. |
| 30 | */ |
| 31 | constructor (parent, chartGroup) { |
| 32 | super(); |
| 33 | |
| 34 | this._children = []; |
| 35 | |
| 36 | this._childOptions = {}; |
| 37 | |
| 38 | this._shareColors = false; |
| 39 | this._shareTitle = true; |
| 40 | this._alignYAxes = false; |
| 41 | |
| 42 | this._rightYAxis = axisRight(); |
| 43 | this._rightYAxisLabel = 0; |
| 44 | this._rightYAxisLabelPadding = DEFAULT_RIGHT_Y_AXIS_LABEL_PADDING; |
| 45 | this._rightY = undefined; |
| 46 | this._rightAxisGridLines = false; |
| 47 | |
| 48 | this._mandatoryAttributes([]); |
| 49 | this.transitionDuration(500); |
| 50 | this.transitionDelay(0); |
| 51 | |
| 52 | this.on('filtered.dcjs-composite-chart', chart => { |
| 53 | // Propagate the filters onto the children |
| 54 | // Notice that on children the call is .replaceFilter and not .filter |
| 55 | // the reason is that _chart.filter() returns the entire current set of filters not just the last added one |
| 56 | for (let i = 0; i < this._children.length; ++i) { |
| 57 | this._children[i].replaceFilter(this.filter()); |
| 58 | } |
| 59 | }); |
| 60 | |
| 61 | this.anchor(parent, chartGroup); |
| 62 | } |
| 63 | |
| 64 | _generateG () { |
| 65 | const g = super._generateG(); |
nothing calls this directly
no test coverage detected