Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(timeline): fix chart can't work when axis line is not shown #17647

Merged
merged 1 commit into from
Sep 14, 2022
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
11 changes: 7 additions & 4 deletions src/component/timeline/SliderTimelineView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class SliderTimelineView extends TimelineView {

this._tickSymbols = [];

// The value is dataIndex, see the costomized scale.
// The value is dataIndex, see the customized scale.
each(ticks, (tick: ScaleTick) => {
const tickCoord = axis.dataToCoord(tick.value);
const itemModel = data.getItemModel<TimelineDataItemOption>(tick.value);
Expand Down Expand Up @@ -470,7 +470,7 @@ class SliderTimelineView extends TimelineView {
this._tickLabels = [];

each(labels, (labelItem) => {
// The tickValue is dataIndex, see the costomized scale.
// The tickValue is dataIndex, see the customized scale.
const dataIndex = labelItem.tickValue;

const itemModel = data.getItemModel<TimelineDataItemOption>(dataIndex);
Expand Down Expand Up @@ -626,8 +626,11 @@ class SliderTimelineView extends TimelineView {
this._currentPointer.x = toCoord;
this._currentPointer.markRedraw();

this._progressLine.shape.x2 = toCoord;
this._progressLine.dirty();
const progressLine = this._progressLine;
if (progressLine) {
progressLine.shape.x2 = toCoord;
progressLine.dirty();
}

const targetDataIndex = this._findNearestTick(toCoord);
const timelineModel = this.model;
Expand Down
1 change: 1 addition & 0 deletions test/runTest/actions/__meta__.json

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

1 change: 1 addition & 0 deletions test/runTest/actions/timeline-case.json

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

113 changes: 113 additions & 0 deletions test/timeline-case.html

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