echarts icon indicating copy to clipboard operation
echarts copied to clipboard

datazoom拖拽能否像highcharts根据拖拽的长度变更周期,从而提升拖拽的性能?

Open 799677446 opened this issue 8 years ago • 1 comments

One-line summary [问题简述]

现在总共有24000多条数据,拖拽超过一半会变得比较卡

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4.0.1
  • Browser version [浏览器类型和版本]: chrome 69.0.3497.100
  • OS Version [操作系统类型和版本]:

Expected behaviour [期望结果]

看了highcharts的demo: https://www.hcharts.cn/demo/highstock/candlestick-and-volume 想问下能否像highcharts,不用渲染太多指标从而提高性能

ECharts option [ECharts配置项]

option = {
   backgroundColor: '#1A253A',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                },
                backgroundColor: 'rgba(48,  69,  95, 0.97)',
                borderWidth: 1,
                borderColor: '#000',
                textStyle: {
                    color: '#8EA5BF'
                },
           },
            toolbox: {
                show: false,
                feature: {
                    dataZoom: {
                        yAxisIndex: false
                    },
                    brush: {
                        type: ['lineX', 'clear']
                    }
                }
            },
            xAxis: {
                type: 'category',
                data: [],
                scale: true,
                boundaryGap: false,
                axisLine: {
                    onZero: false,
                    show: false
                },
                splitLine: { show: false },
               axisTick: {
                    show: false
                },
                splitNumber: 20,
                min: 'dataMin',
                max: 'dataMax',
                axisPointer: {
                    z: 100,
                    lineStyle: {
                        type: 'dashed',
                        color: '#3179ca'
                    },
                    label: this.commonLabel
                }
            },
            datazoom: [
 {
                type: 'inside',
                show: true,
                xAxisIndex: 0,
                startValue: data.dates.slice(-90)[0],
                endValue: data.dates[data.dates.length - 1]
            },
            {
                type: 'slider',
                show: true,
                xAxisIndex: 0,
                startValue: data.dates.slice(-90)[0],
                endValue: data.dates[data.dates.length - 1],
                top: '86%',
                height: '30',
                realtime: false,
            }],
            yAxis: {
                scale: true,
                splitLine: {
                    show: true,
                    lineStyle: {
                        type: 'solid',
                        color: '#2a344a'
                    }
                },
                axisPointer: {
                    show: true,
                    lineStyle: {
                        type: 'dashed',
                        color: '#3179ca'
                    },
                },
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
           },
            grid: {
                top: 50,
                left: '10%',
                right: '8%',
                height: '60%'
            },
            series: [
                {
                    type: 'candlestick',
                    name: '日K',
                    data: [],
                    itemStyle: {
                        normal: {
                            color: 'transparent',
                            color0: '#0CF49B',
                            borderColor: '#FD1050',
                            borderColor0: '#0CF49B'
                        }
                    }
                }
            ]
}

Other comments [其他信息]

799677446 avatar Sep 20 '18 07:09 799677446

对蜡烛图 ECharts 有渲染优化,参见:http://www.echartsjs.com/option.html#series-candlestick.large http://www.echartsjs.com/option.html#series-candlestick.progressive 如果还有性能问题,建议在 http://gallery.echartsjs.com/editor.html 复现下。单纯地减少渲染周期不是很好对解决方法,得先找到原因。

Ovilia avatar Sep 21 '18 05:09 Ovilia