MCPcopy
hub / github.com/apache/echarts / setParallelAxis

Method setParallelAxis

src/component/dataZoom/DataZoomModel.ts:325–348  ·  view source on GitHub ↗
(axisModels: ComponentModel[], axisDim: DataZoomAxisDimension)

Source from the content-addressed store, hash-verified

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).

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
eachFunction · 0.50

Tested by

no test coverage detected