Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/component/axis/AxisBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ const builders: Record<'axisLine' | 'axisTickLabel' | 'axisName', AxisElementsBu

buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);

// This bit fixes the label overlap issue for the Time chart.
// 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') {
if (axisModel.get(['axisLabel', 'hideOverlap'])) {
const labelList = prepareLayoutList(map(labelEls, label => ({
label,
priority: label.z2,
Expand Down
25 changes: 16 additions & 9 deletions src/coord/axisCommonTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ export interface AxisBaseOptionCommon extends ComponentOption,
minorSplitLine?: MinorSplitLineOption;
splitArea?: SplitAreaOption;

// Min value of the axis. can be:
// + ScaleDataValue
// + 'dataMin': use the min value in data.
// + null/undefined: auto decide min value (consider pretty look and boundaryGap).
/**
* Min value of the axis. can be:
* + ScaleDataValue
* + 'dataMin': use the min value in data.
* + null/undefined: auto decide min value (consider pretty look and boundaryGap).
*/
min?: ScaleDataValue | 'dataMin' | ((extent: {min: number, max: number}) => ScaleDataValue);
// Max value of the axis. can be:
// + ScaleDataValue
// + 'dataMax': use the max value in data.
// + null/undefined: auto decide max value (consider pretty look and boundaryGap).
/**
* Max value of the axis. can be:
* + ScaleDataValue
* + 'dataMax': use the max value in data.
* + null/undefined: auto decide max value (consider pretty look and boundaryGap).
*/
max?: ScaleDataValue | 'dataMax' | ((extent: {min: number, max: number}) => ScaleDataValue);
// Optional value can be:
// + `false`: always include value 0.
Expand Down Expand Up @@ -209,7 +213,10 @@ interface AxisLabelBaseOption extends Omit<TextCommonOption, 'color'> {
showMaxLabel?: boolean,
margin?: number,
rich?: Dictionary<TextCommonOption>

/**
* If hide overlapping labels.
*/
hideOverlap?: boolean;
// Color can be callback
color?: ColorString | ((value?: string | number, index?: number) => ColorString)
}
Expand Down
1 change: 1 addition & 0 deletions test/timeScale.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.