Skip to content

[Feature] data sampling in dataZoomSlider #18754

Open

Description

@biggates

What problem does this feature solve?

Consider the following example (or via echarts examples):

let data = [];
for (let i = 1; i < 20000; i++) {
  data.push([i, Math.sin((i / 5) * Math.PI)]);
}
option = {
  xAxis: {},
  yAxis: {},
  dataZoom: [
    {
      start: 0,
      end: 5
    }
  ],
  series: [
    {
      type: 'line',
      symbol: 'none',
      data: data
    }
  ]
};

图片

As the above image shows, the shadow polyline in dataZoom slider does not reflect the correct "shape" (or "outline") of the actual data.

Update: this problem only occurs at specific dimensions, e.g. when #chart-container is width: 1480px.

The data in shadow is resampled here as this._shadowPolygonPts and this._shadowPolylinePts.

This can be improved by applying sampling like lttb.

What does the proposed API look like?

in option:

{
  dataZoom: {
    dataSampling: '', // default none, can be lttb, average, max, min, sum
  }
}

or just

{
  dataZoom: {
    sampling: '', // default none, can be lttb, average, max, min, sum
  }
}

Activity

  1. added
    en
    pending
    on Jun 13, 2023
  2. added
    difficulty: easy
    and removed
    pending
    on Jun 13, 2023
  3. echarts-bot commented on Jun 13, 2023

    @echarts-bot

    This issue is labeled with difficulty: easy.
    @biggates Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.

    Please have a look at How to debug ECharts if you'd like to give a try. 🤓

  4. added this to the TBD milestone on Jun 13, 2023
  5. biggates commented on Apr 3, 2024

    @biggates
    Author

    @Ovilia hello, any chance of PR #18768 gets reviewed by anyone?

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

    difficulty: easyennew-feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions