Skip to content

[Feature] data sampling in dataZoomSlider #18754

@biggates

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
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: easyIssues that can be fixed more easily than the average.enThis issue is in Englishnew-feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions