Skip to content

[Bug] The slider mode dataZoom should clip the background by the borderRadius property #21231

Open

Description

@GordoRank

Version

6.0.0

Link to Minimal Reproduction

N/A

Steps to Reproduce

  • Create a chart with a slider dataZoom.
  • Specify a backgroundColor for the dataZoom
  • Specify a borderRadius for the dataZoom

Current Behavior

The background extends beyond the defined border radius.

Expected Behavior

The background should not extend beyond the defined borderRadius.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

Fixing this issue is trivial.

The current code:

SliderZoomView.prototype._renderBackground = function () {
        var dataZoomModel = this.dataZoomModel;
        var size = this._size;
        var barGroup = this._displayables.sliderGroup;
        var brushSelect = dataZoomModel.get('brushSelect');
        barGroup.add(new Rect$2({
          silent: true,
          shape: {
            x: 0,
            y: 0,
            width: size[0],
            height: size[1]
          },
          style: {
            fill: dataZoomModel.get('backgroundColor')
          },
          z2: -40
        }));

Results in this:

Image

Changing it to:

SliderZoomView.prototype._renderBackground = function () {
        var dataZoomModel = this.dataZoomModel;
        var size = this._size;
        var barGroup = this._displayables.sliderGroup;
        var brushSelect = dataZoomModel.get('brushSelect');
        var borderRadius = dataZoomModel.get('borderRadius');
        barGroup.add(new Rect$2({
          silent: true,
          shape: {
            x: 0,
            y: 0,
            width: size[0],
            height: size[1],
            r: borderRadius
          },
          style: {
            fill: dataZoomModel.get('backgroundColor')
          },
          z2: -40
        }));

Results in a properly clipped rectange:

Image

Activity

  1. added
    en
    pending
    on Aug 27, 2025
  2. removed
    pending
    on Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugen

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions