apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.45k stars 19.61k forks source link

geo3D和bar3D混合使用下bar数据中的最小值的柱子高度为0 #9705

Closed xujunpro2 closed 2 years ago

xujunpro2 commented 5 years ago

在geo3D场景下,bar3D的最小值的柱子高度始终为0,除非设置minHeight,但minHeight也不能随便设置,目前我是通过在bar data中额外增加一个数值为0的数据来实现自动计算最小值的bar高度。 附上代码:

            function loadMap(){
                $.get('shanghai2.json',function(geoJson){
                    //console.info(geoJson);
                    echarts.registerMap('shanghai2',geoJson);
                    var option = {
                                geo3D: {
                                    boxWidth:'60', //三维场景中的宽度
                                    map: 'shanghai2',
                                    itemStyle: {
                                        color: '#1d5e98',
                                        opacity: 1,
                                        borderWidth: 0.4,
                                        borderColor: '#000'
                                      },

                                    viewControl: {
                                        distance: 50,
                                        panMouseButton: 'left',
                                        rotateMouseButton: 'right'
                                    },

                                },

                                series:[
                                    {
                                        type: "bar3D",
                                        coordinateSystem: 'geo3D',
                                        barSize: 1, //柱子粗细
                                        shading: 'lambert',
                                        opacity: 1,
                                        bevelSize:0.3,
                                        label:{show:false,formatter:'{b}',distance:0},
                                        minHeight:0,
                                        data:[
                                            {'name':'a',value:[121.58569335937501,30.908948861695676,20]},
                                            {'name':'b',value:[121.34569335937501,31.008948861695676,10]},
                                            {'name':'c',value:[121.77569335937501,31.008948861695676,30]}
                                        ]

                                    }
                                ]
                    };
                    var chartDiv = document.getElementById('chartDiv');
                    var myChart = echarts.init(chartDiv);   
                    myChart.setOption(option);
                });
            }
Ovilia commented 5 years ago

Hi @xujunpro2 . Thanks for using ECharts. Please do not open the same issues, which may be a burden for us to deal with. And you should not paste all the json data in your description, which makes the page too long to read. On the other hand, you should follow the issue template and provide online demo on http://gallery.echartsjs.com/editor.html or http://jsfiddle.net . Please edit your issue and @pissang will have a look at it then.

xujunpro2 commented 5 years ago

@pissang 另外那个重复提交是当时github网站出了问题导致的,并非我有意为之,对造成你们工作的困扰,表示歉意:)

xujunpro2 commented 5 years ago

@pissang hi,刚才已经在editor提交了bug 的demo,网址是:https://gallery.echartsjs.com/editor.html?c=xXXHUfZ27Q&v=1 请注意name为‘a’的bar,值为10,但高度明显和另外两个柱子不成比例,我猜想是echarts把data中的最小值的bar的高度设置成了0

936695852 commented 4 years ago

https://segmentfault.com/q/1010000023809644/a-1020000023881832

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] commented 2 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!