(axisModels: ComponentModel[], axisDim: DataZoomAxisDimension)
| 323 | } |
| 324 | |
| 325 | function setParallelAxis(axisModels: ComponentModel[], axisDim: DataZoomAxisDimension): void { |
| 326 | // At least use the first parallel axis as the target axis. |
| 327 | const axisModel = axisModels[0]; |
| 328 | if (!axisModel) { |
| 329 | return; |
| 330 | } |
| 331 | |
| 332 | const axisInfo = new DataZoomAxisInfo(); |
| 333 | axisInfo.add(axisModel.componentIndex); |
| 334 | targetAxisIndexMap.set(axisDim, axisInfo); |
| 335 | needAuto = false; |
| 336 | |
| 337 | // Find parallel axes in the same grid. |
| 338 | if (axisDim === 'x' || axisDim === 'y') { |
| 339 | const gridModel = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]; |
| 340 | gridModel && each(axisModels, function (axModel) { |
| 341 | if (axisModel.componentIndex !== axModel.componentIndex |
| 342 | && gridModel === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0] |
| 343 | ) { |
| 344 | axisInfo.add(axModel.componentIndex); |
| 345 | } |
| 346 | }); |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | if (needAuto) { |
| 351 | // If no parallel axis, find the first category axis as default. (Also consider polar). |
nothing calls this directly
no test coverage detected