(seriesInfoList)
| 35581 | } |
| 35582 | |
| 35583 | function doCalBarWidthAndOffset(seriesInfoList) { |
| 35584 | // Columns info on each category axis. Key is cartesian name |
| 35585 | var columnsMap = {}; |
| 35586 | each(seriesInfoList, function (seriesInfo, idx) { |
| 35587 | var axisKey = seriesInfo.axisKey; |
| 35588 | var bandWidth = seriesInfo.bandWidth; |
| 35589 | var columnsOnAxis = columnsMap[axisKey] || { |
| 35590 | bandWidth: bandWidth, |
| 35591 | remainedWidth: bandWidth, |
| 35592 | autoWidthCount: 0, |
| 35593 | categoryGap: null, |
| 35594 | gap: '20%', |
| 35595 | stacks: {} |
| 35596 | }; |
| 35597 | var stacks = columnsOnAxis.stacks; |
| 35598 | columnsMap[axisKey] = columnsOnAxis; |
| 35599 | var stackId = seriesInfo.stackId; |
| 35600 | |
| 35601 | if (!stacks[stackId]) { |
| 35602 | columnsOnAxis.autoWidthCount++; |
| 35603 | } |
| 35604 | |
| 35605 | stacks[stackId] = stacks[stackId] || { |
| 35606 | width: 0, |
| 35607 | maxWidth: 0 |
| 35608 | }; // Caution: In a single coordinate system, these barGrid attributes |
| 35609 | // will be shared by series. Consider that they have default values, |
| 35610 | // only the attributes set on the last series will work. |
| 35611 | // Do not change this fact unless there will be a break change. |
| 35612 | |
| 35613 | var barWidth = seriesInfo.barWidth; |
| 35614 | |
| 35615 | if (barWidth && !stacks[stackId].width) { |
| 35616 | // See #6312, do not restrict width. |
| 35617 | stacks[stackId].width = barWidth; |
| 35618 | barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); |
| 35619 | columnsOnAxis.remainedWidth -= barWidth; |
| 35620 | } |
| 35621 | |
| 35622 | var barMaxWidth = seriesInfo.barMaxWidth; |
| 35623 | barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); |
| 35624 | var barMinWidth = seriesInfo.barMinWidth; |
| 35625 | barMinWidth && (stacks[stackId].minWidth = barMinWidth); |
| 35626 | var barGap = seriesInfo.barGap; |
| 35627 | barGap != null && (columnsOnAxis.gap = barGap); |
| 35628 | var barCategoryGap = seriesInfo.barCategoryGap; |
| 35629 | barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); |
| 35630 | }); |
| 35631 | var result = {}; |
| 35632 | each(columnsMap, function (columnsOnAxis, coordSysName) { |
| 35633 | result[coordSysName] = {}; |
| 35634 | var stacks = columnsOnAxis.stacks; |
| 35635 | var bandWidth = columnsOnAxis.bandWidth; |
| 35636 | var categoryGapPercent = columnsOnAxis.categoryGap; |
| 35637 | |
| 35638 | if (categoryGapPercent == null) { |
| 35639 | var columnCount = keys(stacks).length; // More columns in one group |
| 35640 | // the spaces between group is smaller. Or the column will be too thin. |
no test coverage detected
searching dependent graphs…