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(datazoom): prevent bar and scatter chart overflowing the graph . … #20718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 16 additions & 1 deletion src/component/dataZoom/AxisProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,22 @@ class AxisProxy {
const valueWindow = this._valueWindow;

if (filterMode === 'none') {
return;
each(seriesModels, function (seriesModel) {
if (seriesModel.subType === 'bar' || seriesModel.subType === 'scatter') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may not be a good idea to check subType here because AxisProxy should have no idea of what series type is. These logic should probably be implemented in their own series code.

// For series type bar and scatter, get the range bound data so that the
// bar and scatter bubbles should not exceed beyond the axis.
// Instead of clipping the bars in such scenario,
// it should show the whole bars within the range.
const seriesData = seriesModel.getData();
const dataDims = seriesData.mapDimensionsAll(axisDim);
each(dataDims, function (dim) {
const range: Dictionary<[number, number]> = {};
range[dim] = valueWindow;
seriesData.selectRange(range);
});
}
});
return;
}

// FIXME
Expand Down