Skip to content
Open
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
7 changes: 4 additions & 3 deletions src/chart/bar/BarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ type RealtimeSortConfig = {
// Return a number, based on which the ordinal sorted.
type OrderMapping = (dataIndex: number) => number;

function getClipArea(coord: CoordSysOfBar, data: SeriesData) {
function getClipArea(coord: CoordSysOfBar, data: SeriesData, strictClip?: boolean) {
const coordSysClipArea = coord.getArea && coord.getArea();
if (isCoordinateSystemType<Cartesian2D>(coord, 'cartesian2d')) {
const baseAxis = coord.getBaseAxis();
// When boundaryGap is false or using time axis. bar may exceed the grid.
// We should not clip this part.
// See test/bar2.html
if (baseAxis.type !== 'category' || !baseAxis.onBand) {
if (!strictClip && (baseAxis.type !== 'category' || !baseAxis.onBand)) {
const expandWidth = data.getLayout('bandWidth');
if (baseAxis.isHorizontal()) {
(coordSysClipArea as CartesianCoordArea).x -= expandWidth;
Expand Down Expand Up @@ -220,7 +220,8 @@ class BarView extends ChartView {
}

const needsClip = seriesModel.get('clip', true) || realtimeSortCfg;
const coordSysClipArea = getClipArea(coord, data);
const strictClip = seriesModel.get('clip', true);
const coordSysClipArea = getClipArea(coord, data, strictClip);
// If there is clipPath created in large mode. Remove it.
group.removeClipPath();
// We don't use clipPath in normal mode because we needs a perfect animation
Expand Down
Loading