Skip to content

Commit

Permalink
Use map and have a fallback z2 value
Browse files Browse the repository at this point in the history
  • Loading branch information
svedova committed Aug 26, 2021
1 parent 319ac07 commit 563fc01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/component/axis/AxisBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import {retrieve, defaults, extend, each, isObject} from 'zrender/src/core/util';
import {retrieve, defaults, extend, each, isObject, map} from 'zrender/src/core/util';
import * as graphic from '../../util/graphic';
import {getECData} from '../../util/innerStore';
import {createTextStyle} from '../../label/labelStyle';
Expand Down Expand Up @@ -352,7 +352,7 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu
// This bit fixes the label overlap issue for the Time chart.
// See https://github.com/apache/echarts/issues/14266 for more.
if (axisModel.get('type') === 'time') {
const labelList = prepareLayoutList(labelEls.map(label => ({
const labelList = prepareLayoutList(map(labelEls, label => ({
label,
priority: label.z2,
defaultAttr: {
Expand Down Expand Up @@ -781,7 +781,7 @@ function buildAxisLabel(
y: opt.labelOffset + opt.labelDirection * labelMargin,
rotation: labelLayout.rotation,
silent: silent,
z2: labelItem.level,
z2: 10 + (labelItem.level || 0),
style: createTextStyle(itemLabelModel, {
text: formattedLabel,
align: itemLabelModel.getShallow('align', true)
Expand Down

0 comments on commit 563fc01

Please sign in to comment.