echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] type custom 增加dataZoom缩小在放大后消失

Open a949066041 opened this issue 3 years ago • 1 comments

Version

5.3.3

Link to Minimal Reproduction

No response

Steps to Reproduce

option = { legend: {

}, dataZoom: {

}, grid: { left: '3%', right: '3%', top: '1%', bottom: '10%', containLabel: true }, xAxis: { type: 'time', min: '2018-08-25 00:00:00', max: '2018-08-27 00:00:00', textStyle: { color: '#f0f0f0' } }, yAxis: { data: ['test'], textStyle: { color: '#f0f0f0' } }, series: [ { avoidLabelOverlap: true, type: 'custom', selectedMode: 'single', labelLayout: { hideOverlap: false }, legendHoverLink: false, renderItem: function (params, api) { var categoryIndex = api.value(0) var start = api.coord([api.value(1), categoryIndex]) var end = api.coord([api.value(2), categoryIndex]) var height = 24

    return {
      type: 'rect',
      shape: echarts.graphic.clipRectByRect({
        x: start[0],
        y: start[1] - height / 2,
        width: end[0] - start[0],
        height: height
      }, {
        x: params.coordSys.x,
        y: params.coordSys.y,
        width: params.coordSys.width,
        height: params.coordSys.height
      }),
      style: api.style()
    }
  },
  encode: {
    x: [1, 2],
    y: 0
  },
  data: [
      {
        z: 10000,
        itemStyle: { normal: { color: 'red' }},
        name: 'test1',
        value: [1, '2018-08-25 00:00:00', '2018-08-25 23:59:59']
      },
      // dataItem
      {
        z: 0,
        name: 'test2',
        value: [1, '2018-08-25 02:00:00', '2018-08-25 03:00:00']
      }
    ]
}

] }

Current Behavior

  1. dataZoom缩小后在重置后,中间蓝色条消失。
  2. 悬浮在红色上面,有没有方法蓝色不消失

Expected Behavior

  1. dataZoom缩小后在重置后,蓝色条和初始值一样。
  2. 悬浮在红色上面,蓝色不消失

Environment

- OS:window 10
- Browser:Chrome
- Framework:vue2

Any additional comments?

No response

a949066041 avatar Sep 20 '22 10:09 a949066041

@a949066041 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] type custom add dataZoom to zoom out and disappear after zooming in

echarts-bot[bot] avatar Sep 20 '22 10:09 echarts-bot[bot]