Skip to content

Commit

Permalink
Use z2 instead of zlevel for priority
Browse files Browse the repository at this point in the history
  • Loading branch information
svedova committed Aug 25, 2021
1 parent 7d33cfb commit 319ac07
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/component/axis/AxisBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ 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.type === 'xAxis.time') {
if (axisModel.get('type') === 'time') {
const labelList = prepareLayoutList(labelEls.map(label => ({
label,
priority: label.zlevel,
priority: label.z2,
defaultAttr: {
ignore: label.ignore
}
Expand Down Expand Up @@ -781,7 +781,7 @@ function buildAxisLabel(
y: opt.labelOffset + opt.labelDirection * labelMargin,
rotation: labelLayout.rotation,
silent: silent,
z2: 10,
z2: labelItem.level,
style: createTextStyle(itemLabelModel, {
text: formattedLabel,
align: itemLabelModel.getShallow('align', true)
Expand Down Expand Up @@ -824,8 +824,6 @@ function buildAxisLabel(
transformGroup.add(textEl);
textEl.updateTransform();

textEl.zlevel = labelItem.level;

labelEls.push(textEl);
group.add(textEl);

Expand Down

0 comments on commit 319ac07

Please sign in to comment.