echarts icon indicating copy to clipboard operation
echarts copied to clipboard

K线图表为什么会这样???!!!K线的阴阳烛空心问题。。

Open git-stf-01 opened this issue 8 years ago • 8 comments

K线的阴阳烛空心问题。。 [问题简述]

Version & Environment [版本及环境]

  • echarts-4.2.0-rc.1.js

Expected behaviour [期望结果]

希望能空心显示。。。

ECharts option [ECharts配置项]

option = {
            xAxis: {
                data: ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27']
            },
            yAxis: {
                scale: true
            },
            series: [{
                type: 'k',
                data: [
                    [97.05, 98.95, 99.00, 97.05],
                    [99.50, 98.50, 99.50, 98.15],
                    [97.50, 97.30, 98.50, 96.85],
                    [96.55, 97.25, 97.30, 95.75]
                ],
                // data: [
                //     [20, 30, 10, 35],
                //     [40, 35, 30, 55],
                //     [33, 38, 33, 40],
                //     [40, 40, 32, 42]
                // ],
                itemStyle: {
                    color: 'transparent',
                    color0: 'green',
                    borderColor: 'red',
                    borderColor0: 'green'
                }
            }]
        };

### Other comments [其他信息]
两组数据效果完全不同。。
97.05--那一组数据非空心。。。中间多了一根线;
20--那一组数据为空心。。。显示正常

git-stf-01 avatar Sep 24 '18 06:09 git-stf-01

4.2.0-rc.1 版本没有复现出问题,请更新到最新版本 Duplicate of #9094

Ovilia avatar Sep 25 '18 02:09 Ovilia

@Ovilia 我用的就是4.2.0-rc.1版啊。。 甚至把上面的配置项,在这里都不对。。。 http://gallery.echartsjs.com/editor.html

git-stf-01 avatar Sep 26 '18 01:09 git-stf-01

k

git-stf-01 avatar Sep 26 '18 01:09 git-stf-01

如图所示。。中间有红色的线。。。难道不应该是空心烛吗?

git-stf-01 avatar Sep 26 '18 01:09 git-stf-01

试试颜色设置成背景色?

pissang avatar Sep 26 '18 06:09 pissang

@pissang 好像还是不行。。 option = { xAxis: { data: ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27'] }, yAxis: { scale: true }, backgroundColor : '#fff', series: [{ type: 'k', data: [ [97.05, 98.95, 99.00, 97.05], [99.50, 98.50, 99.50, 98.15], [97.50, 97.30, 98.50, 96.85], [96.55, 97.25, 97.30, 95.75] ], // data: [ // [20, 30, 10, 35], // [40, 35, 30, 55], // [33, 38, 33, 40], // [40, 40, 32, 42] // ], itemStyle: { color: '#fff', color0: 'green', borderColor: 'red', borderColor0: 'green' } }] };

git-stf-01 avatar Sep 26 '18 06:09 git-stf-01

找到问题了。。。我的问题; @Ovilia @pissang 文档中有这样的配置说明:series里面: dimensions: ['date', 'open', 'close', 'highest', 'lowest'], encode: { x: 'date', y: ['open', 'close', 'highest', 'lowest'] } 其实k线图中的数据顺序应该是y: ['open', 'close', 'lowest', 'highest']; 因为低高顺序错误。。导致的; series[i]-candlestick.data[i].value Array

git-stf-01 avatar Dec 20 '18 05:12 git-stf-01

确实如此,已通过调整oclh的顺序优化了效果,完美解决 image

找到问题了。。。我的问题; @Ovilia @pissang 文档中有这样的配置说明:series里面: dimensions: ['date', 'open', 'close', 'highest', 'lowest'], encode: { x: 'date', y: ['open', 'close', 'highest', 'lowest'] } 其实k线图中的数据顺序应该是y: ['open', 'close', 'lowest', 'highest']; 因为低高顺序错误。。导致的; series[i]-candlestick.data[i].value Array

vixony avatar Jul 30 '24 07:07 vixony