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

[GitHub] leexuGit opened a new issue #9482: 旭日图下钻后,无法上卷

leexuGit opened a new issue #9482: 旭日图下钻后,无法上卷
URL: https://github.com/apache/incubator-echarts/issues/9482
 
 
   <!--
   Thanks for choosing ECharts!
   感谢使用 ECharts!
   
   It's highly recommended to use English in issues, to help others having the same problem in the future.
   加入 Apache 开源基金会后,我们有了更多国外的用户。为了方便社区用户,强烈建议在 issue 中使用英文。
   
   Please check the following questions to let our bot help.
   请回答以下问题,以帮助我们的机器人维护 issue。
   
   To check the option, add x in [ ], e.g.: [x] I am ...
   勾选的方式:在 [ ] 中加入 x,变成:[x] I am ... 的形式。
   -->
   
   - [ ] I am using English in this issue. 在这个 Issue 中我使用了英文(强烈建议)。
   
   
   ## General Questions
   
   <!-- BEGINNING OF REQUIRED FIELDS 必填项开始 -->
   
   
   PLEASE MAKE SURE OF ALL THE FOLLOWING OPTIONS IN REQUIRED FIELDS ARE TICKED (with x)!
   Otherwise, the issue will not be answered.
   And think before you tick. :)
   请确保以下每项都打上勾了!并且确保都做了这些事哦~ 这将大量简化我们的工作流程,使你的问题更快速得到解答。
   
   - [x ] Required: I have read the document and examples and tried to solve it by myself. (必填)我读过了文档和教程,并且曾试图自己解决问题。
   - [x ] Required: I have searched for similar issues and that didn't help. (必填)我搜索过 issue 但是没有帮助。
   - [ x] Required: I have tried with the latest version of ECharts and still have this problem. (必填)我试过最新版本的 ECharts,还是存在这个问题。
   
   In this issue, I have provided information with: 在这个 issue 中我提供了以下信息:
   - [x ] Required: issue type;(必填)issue 类型
   - [x ] Required: one sentence description in issue details;(必填)一句话的问题描述
   - [x ] Required: demo;(必填)能反映问题的例子(如果你想提问或报 bug)
   - [ ] Required: ECharts version;ECharts 版本
   
   <!-- END OF REQUIRED FIELDS 必填项结束 -->
   
   
   
   
   
   ## Issue Type
   
   <!-- Add `x` for the ones that is true with you, e.g.: [x] I have ... -->
   
   - [ ] I have a question to ask about *how to use ECharts to ...*;我想提问如何使用 ECharts 实现某功能
   - [x ] I have a bug to report;我想要报 bug
   - [ ] I have a feature to request, e.g.: *I'd like a new feature that ...*;我需要一个新功能
   - [ ] I have a feature to enhance, e.g.: *The current feature should be improved in the way that ...*;我希望改进某个功能
   - [ ] There's something wrong with the documents;文档有些问题
   - [ ] Others, or I'm not sure which issue types to choose here;其他,或我不知道应该选什么类型
   
   
   ## Issue Details
   
   <!-- Use one sentence to describe what you want and what's wrong. 一句话描述问题。 -->
   
   旭日图下钻后,无法上卷
   
   
   ### Expected Behavior
   
   <!-- Add screenshots to demo if necessary. 期望的效果。 -->
   
   旭日图下钻后,可以上卷,回到初始状态
   
   
   ### Current Behavior
   
   <!-- Add screenshots to demo if necessary. Otherwise, replace the following line with N/A. 现在的效果。 -->
   
   旭日图下钻后,无法上卷
   
   
   
   ### Online Example
   
   <!-- Please use jsfiddle.net or gallery.echartsjs.com to provide a simplest demo to show the problem. And do not upload zip demos. 请使用 gallery.echartsjs.com 提供最简单可运行的代码,请不要上传 zip 文件。 -->
   THIS IS REQUIRED FOR ALL BUG REPORTS AND QUESTIONS!!! 如果是提问或报 bug 一定要提供这一项!
   
   [http://gallery.echartsjs.com/editor.html?c=xoJdFfRpPL&comment=0](url)
   
   <!-- Please make your demo as simple as possible to help locate the problem. And paste only necessary part of code here. 提供必要的代码,不要全部粘贴。 -->
   
    var colors = ['#FFAE57', '#FF7853', '#EA5151', '#CC3F57', '#9A2555'];
   var bgColor = '#2E2733';
   
   var itemStyle = {
       star5: {
           color: colors[0]
       },
       star4: {
           color: colors[1]
       },
       star3: {
           color: colors[2]
       },
       star2: {
           color: colors[3]
       }
   };
   
   var data = [{
       name: '虚构',
       itemStyle: {
           normal: {
               color: colors[1]
           }
       },
       children: [{
           name: '小说',
           children: [{
               name: '5☆',
               children: [{
                   name: '疼'
               }, {
                   name: '慈悲'
               }, {
                   name: '楼下的房客'
               }]
           }, {
               name: '4☆',
               children: [{
                   name: '虚无的十字架'
               }, {
                   name: '无声告白'
               }, {
                   name: '童年的终结'
               }]
           }, {
               name: '3☆',
               children: [{
                   name: '疯癫老人日记'
               }]
           }]
       }, {
           name: '其他',
           children: [{
               name: '5☆',
               children: [{
                   name: '纳博科夫短篇小说全集'
               }]
           }, {
               name: '4☆',
               children: [{
                   name: '安魂曲'
               }, {
                   name: '人生拼图版'
               }]
           }, {
               name: '3☆',
               children: [{
                   name: '比起爱你,我更需要你'
               }]
           }]
       }]
   }, {
       name: '非虚构',
       itemStyle: {
           color: colors[2]
       },
       children: [{
           name: '设计',
           children: [{
               name: '5☆',
               children: [{
                   name: '无界面交互'
               }]
           }, {
               name: '4☆',
               children: [{
                   name: '数字绘图的光照与渲染技术'
               }, {
                   name: '日本建筑解剖书'
               }]
           }, {
               name: '3☆',
               children: [{
                   name: '奇幻世界艺术\n&RPG地图绘制讲座'
               }]
           }]
       }, {
           name: '社科',
           children: [{
               name: '5☆',
               children: [{
                   name: '痛点'
               }]
           }, {
               name: '4☆',
               children: [{
                   name: '卓有成效的管理者'
               }, {
                   name: '进化'
               }, {
                   name: '后物欲时代的来临',
               }]
           }, {
               name: '3☆',
               children: [{
                   name: '疯癫与文明'
               }]
           }]
       }, {
           name: '心理',
           children: [{
               name: '5☆',
               children: [{
                   name: '我们时代的神经症人格'
               }]
           }, {
               name: '4☆',
               children: [{
                   name: '皮格马利翁效应'
               }, {
                   name: '受伤的人'
               }]
           }, {
               name: '3☆',
           }, {
               name: '2☆',
               children: [{
                   name: '迷恋'
               }]
           }]
       }, {
           name: '居家',
           children: [{
               name: '4☆',
               children: [{
                   name: '把房子住成家'
               }, {
                   name: '只过必要生活'
               }, {
                   name: '北欧简约风格'
               }]
           }]
       }, {
           name: '绘本',
           children: [{
               name: '5☆',
               children: [{
                   name: '设计诗'
               }]
           }, {
               name: '4☆',
               children: [{
                   name: '假如生活糊弄了你'
               }, {
                   name: '博物学家的神秘动物图鉴'
               }]
           }, {
               name: '3☆',
               children: [{
                   name: '方向'
               }]
           }]
       }, {
           name: '哲学',
           children: [{
               name: '4☆',
               children: [{
                   name: '人生的智慧'
               }]
           }]
       }, {
           name: '技术',
           children: [{
               name: '5☆',
               children: [{
                   name: '代码整洁之道'
               }]
           }, {
               name: '4☆',
               children: [{
                   name: 'Three.js 开发指南'
               }]
           }]
       }]
   }];
   
   for (var j = 0; j < data.length; ++j) {
       var level1 = data[j].children;
       for (var i = 0; i < level1.length; ++i) {
           var block = level1[i].children;
           var bookScore = [];
           var bookScoreId;
           for (var star = 0; star < block.length; ++star) {
               var style = (function (name) {
                   switch (name) {
                       case '5☆':
                           bookScoreId = 0;
                           return itemStyle.star5;
                       case '4☆':
                           bookScoreId = 1;
                           return itemStyle.star4;
                       case '3☆':
                           bookScoreId = 2;
                           return itemStyle.star3;
                       case '2☆':
                           bookScoreId = 3;
                           return itemStyle.star2;
                   }
               })(block[star].name);
   
               block[star].label = {
                   color: style.color,
                   downplay: {
                       opacity: 0.5
                   }
               };
   
               if (block[star].children) {
                   style = {
                       opacity: 1,
                       color: style.color
                   };
                   block[star].children.forEach(function (book) {
                       book.value = 1;
                       book.itemStyle = style;
   
                       book.label = {
                           color: style.color
                       };
   
                       var value = 1;
                       if (bookScoreId === 0 || bookScoreId === 3) {
                           value = 5;
                       }
   
                       if (bookScore[bookScoreId]) {
                           bookScore[bookScoreId].value += value;
                       }
                       else {
                           bookScore[bookScoreId] = {
                               color: colors[bookScoreId],
                               value: value
                           };
                       }
                   });
               }
           }
   
           level1[i].itemStyle = {
               color: data[j].itemStyle.color
           };
       }
   }
   
   option = {
       backgroundColor: bgColor,
       color: colors,
       series: [{
           type: 'sunburst',
           center: ['50%', '48%'],
           data: data,
           sort: function (a, b) {
               if (a.depth === 1) {
                   return b.getValue() - a.getValue();
               }
               else {
                   return a.dataIndex - b.dataIndex;
               }
           },
           label: {
               rotate: 'radial',
               color: bgColor
           },
           itemStyle: {
               borderColor: bgColor,
               borderWidth: 2
           },
           levels: [{}, {
               r0: 0,
               r: 40,
               label: {
                   rotate: 0
               }
           }, {
               r0: 40,
               r: 105
           }, {
               r0: 115,
               r: 140,
               itemStyle: {
                   shadowBlur: 2,
                   shadowColor: colors[2],
                   color: 'transparent'
               },
               label: {
                   rotate: 'tangential',
                   fontSize: 10,
                   color: colors[0]
               }
           }, {
               r0: 140,
               r: 145,
               itemStyle: {
                   shadowBlur: 80,
                   shadowColor: colors[0]
               },
               label: {
                   position: 'outside',
                   textShadowBlur: 5,
                   textShadowColor: '#333',
               },
               downplay: {
                   label: {
                       opacity: 0.5
                   }
               }
           }]
       }]
   };
   
   
   
   ## Topics
   
   <!-- Check those topics that are related. 选择相关主题。 -->
   - [ ] Legend
   - [ ] Tooltip
   - [ ] Event
   - [ ] Performance
   - [ ] SVG
   - [ ] Map
   - [ ] ECharts GL
   - [ ] Third-party libraries, e.g.: Vue.js, React
   
   
   ## Anything Else We Need to Know
   
   <!-- You may reference other issues here. Otherwise, replace the following line with N/A.  其他我们需要知道的东西,比如引用其他 issue。 -->
   
   {DESCRIBE_HERE}
   
   
   ## Environment
   
   - ECharts version;ECharts 版本: {DESCRIBE_HERE}
   
   - [ ] It happens only on certain browsers or operating systems. 对于特定浏览器或操作系统才会出现的问题,请提供相应环境信息:{BROWSER_VERSION_OR_OS_INFORMATION_HERE}
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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