DoesntWong opened a new issue #11321: 多系列柱状图,能否只显示其中的某几项,不要出现占位或者空 URL: https://github.com/apache/incubator-echarts/issues/11321 ### What problem does this feature solve? 这边的需求是有多个系列,希望只取数值前三的三个系列,因为系列是按照顺序排序的,如果data传null,就会出现占位的情况,这样看起来很乱 ### What does the proposed API look like? 我希望能有一个API,可以不显示data为null的柱状图,且不占位 ```javascript option = { color: ['#003366', '#006699', '#4cabce', '#e5323e'], tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, legend: { data: ['Forest', 'Steppe', 'Desert', 'Wetland'] }, toolbox: { show: true, orient: 'vertical', left: 'right', top: 'center', feature: { mark: {show: true}, dataView: {show: true, readOnly: false}, magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']}, restore: {show: true}, saveAsImage: {show: true} } }, calculable: true, xAxis: [ { type: 'category', axisTick: {show: false}, data: ['2012', '2013', '2014', '2015', '2016'] } ], yAxis: [ { type: 'value' } ], series: [ { name: 'Forest', type: 'bar', barGap: 0, data: [320, 332, 301, 334, 390] }, { name: 'Steppe', type: 'bar', data: [220, 182, 191, null, 290] }, { name: 'Desert', type: 'bar', data: [null, null, null, 154, null] }, { name: 'Wetland', type: 'bar', data: [98, 77, 101, 99, 40] } ] }; ``` <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
