You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/05/14 02:11:38 UTC

[GitHub] [incubator-echarts] TRSK-CONMI opened a new issue #12622: 【渲染问题】【柱状图】在数据间隔比较小的时候没有问题,但数据间隔为1的时候就有问题了

TRSK-CONMI opened a new issue #12622:
URL: https://github.com/apache/incubator-echarts/issues/12622


   ### 现状:
   ![Snipaste_2020-05-14_10-06-26](https://user-images.githubusercontent.com/39817817/81884557-cb011680-95ca-11ea-9243-eca0d2cb152b.jpg)
   
   ### 代码:
   ``<!DOCTYPE html>
   <!--
   To change this license header, choose License Headers in Project Properties.
   To change this template file, choose Tools | Templates
   and open the template in the editor.
   -->
   <html>
       <head>
           <title>TODO supply a title</title>
           <meta charset="UTF-8">
           <meta name="viewport" content="width=device-width, initial-scale=1.0">
           <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
           <script src="https://cdn.bootcdn.net/ajax/libs/echarts/4.7.0/echarts.common.min.js"></script>
       </head>
       <body>
           <div id="echart1_ele" style="width: 100%;height:400px;padding-left: 0;padding-right: 5px;"></div>
   
           <script type="text/javascript">
               var selectEventArrays_1_name = ['区域1', '区域2', '区域3', '区域4', '区域5'];//区域统计条件
               var echart1_ele_data = [132468, 132468, 132468, 132467, 132467];//区域统计-累计用电量data
   
               $(function () {
                   echart1();
               });
   
               function echart1() {
                   echart1_ele();
               }
   
               function echart1_ele() {
                   // 基于准备好的dom,初始化echarts实例
                   var echart1_ele = echarts.init(document.getElementById('echart1_ele'));
                   // 指定图表的配置项和数据
                   var option = {
                       tooltip: {//提示框组件
                           trigger: 'axis'
                       },
                       legend: {//图例组件
                           data: ['累计用电量'] //图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 name
                       },
                       toolbox: {
                           show: true,
                           feature: {
                               mark: {show: true},
                               dataView: {show: true, readOnly: false},
                               magicType: {show: true, type: ['line', 'bar']},
                               restore: {show: true},
                               saveAsImage: {show: true}
                           }
                       },
                       calculable: true,
                       xAxis: [//直角坐标系 grid 中的 x 轴
                           {
                               type: 'category',
                               axisLabel: {
                                   interval: 0,
                                   rotate: 40
                               },
                               data: selectEventArrays_1_name,
                               boundaryGap: ['5%', '5%']//留白大小,坐标轴两边留白
                           }
                       ],
                       yAxis: [
                           {
                               name: '单位(kWh)',
                               type: 'value',
                               axisTick: {
                                   inside: true
                               },
                               scale: true,
                               axisLabel: {
                                   margin: 2,
                                   formatter: function (value, index) {
                                       if (value >= 10000 && value < 10000000) {
                                           value = (value / 10000).toFixed(4) + "万";
                                       } else if (value >= 10000000) {
                                           value = (value / 10000000).toFixed(7) + "千万";
                                       }
                                       return value;
                                   }
                               }
                           }
                       ],
                       series: [//系列列表
                           {
                               name: '累计用电量', //系列名称,用于tooltip的显示,legend 的图例筛选
                               type: 'bar', //类型
                               data: echart1_ele_data, //系列中的数据内容数组。数组项通常为具体的数据项
                               itemStyle: {//上方显示数值
                                   normal: {
                                       label: {
                                           show: true, //开启显示
                                           position: 'inside', //在上方显示
                                           textStyle: {//数值样式
                                               color: 'black',
                                               fontSize: 16
                                           }
                                       },
                                       color: function (params) {
                                           //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
                                           var colorList = ['#2584cd'];
                                           return colorList[params.dataIndex]
                                       }
                                   }
                               }
                           }
                       ]
                   }
                   echart1_ele.clear();
                   echart1_ele.setOption(option);
               }
           </script>
       </body>
   </html>``


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] echarts-bot[bot] closed issue #12622: 【渲染问题】【柱状图】在数据间隔比较小的时候没有问题,但数据间隔为1的时候就有问题了

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] closed issue #12622:
URL: https://github.com/apache/incubator-echarts/issues/12622


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #12622: 【渲染问题】【柱状图】在数据间隔比较小的时候没有问题,但数据间隔为1的时候就有问题了

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12622:
URL: https://github.com/apache/incubator-echarts/issues/12622#issuecomment-628343243


   This issue is not created using [issue template](https://ecomfe.github.io/echarts-issue-helper/) so I'm going to close it. 🙊
   Sorry for this, but it helps save our maintainers' time so that more developers get helped.
   Feel free to create another issue using the issue template.
   
   If you think you have already made your point clear without the template, or your problem cannot be covered by it, you may re-open this issue again.
   
   这个 issue 未使用 [issue 模板](https://ecomfe.github.io/echarts-issue-helper/?lang=zh-cn) 创建,所以我将关闭此 issue。
   为此带来的麻烦我深表歉意,但是请理解这是为了节约社区维护者的时间,以更高效地服务社区的开发者群体。
   如果您愿意,可以请使用 issue 模板重新创建 issue。
   
   如果你认为虽然没有使用模板,但你已经提供了复现问题的充分描述,或者你的问题无法使用模板表达,也可以重新 open 这个 issue。


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org