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 2022/07/18 13:15:14 UTC

[GitHub] [echarts] hi-mashuo opened a new issue, #17396: [Feature] echarts横向柱状图根据不同数据展示不同颜色问题

hi-mashuo opened a new issue, #17396:
URL: https://github.com/apache/echarts/issues/17396

   ### What problem does this feature solve?
   
   您好,我对于echarts某些功能不太理解,所以前来请教,
   我之前实现了纵向柱状根据不同数据来展示不同的渐变色,现在我需要把纵向改为横向,改完后发现数据是倒叙显示的,并且颜色显示不正确,望回复!谢谢!!!
   
   ### What does the proposed API look like?
   
   无


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

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] [echarts] hi-mashuo commented on issue #17396: [Feature] echarts横向柱状图根据不同数据展示不同颜色问题

Posted by GitBox <gi...@apache.org>.
hi-mashuo commented on issue #17396:
URL: https://github.com/apache/echarts/issues/17396#issuecomment-1189862479

   非常感谢,麻烦您了


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] hi-mashuo commented on issue #17396: [Feature]

Posted by GitBox <gi...@apache.org>.
hi-mashuo commented on issue #17396:
URL: https://github.com/apache/echarts/issues/17396#issuecomment-1187389894

   ![微信截图_20220718211233](https://user-images.githubusercontent.com/62926576/179518862-a3077654-754d-432c-b3da-56938ff1f7c2.png)
   之前


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] echarts-bot[bot] closed issue #17396: [Feature]

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


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] echarts-bot[bot] commented on issue #17396: [Feature]

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

   I'm sorry to close this issue for it lacks the necessary title. Please provide **a _descriptive_ and as _concise_ as possible title to describe your problems or requests** and then the maintainers or I will reopen this issue.
   
   Every good bug report or feature request starts with a title. Your issue title is a critical element as it's the first thing maintainers see.
   
   A good issue title makes it easier for maintainers to understand what the issue is, easily locate it, and know what steps they'll need to take to fix it.
   
   Moreover, it's better to include keywords, as this makes it easier to find the issue self and similar issues in searches.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] hi-mashuo commented on issue #17396: [Feature]

Posted by GitBox <gi...@apache.org>.
hi-mashuo commented on issue #17396:
URL: https://github.com/apache/echarts/issues/17396#issuecomment-1187392696

   横向代码
   `
   option = {
     tooltip: {
       show: false
     },
     yAxis: {
       splitLine: {
         show: true,
         lineStyle: {
           color: 'rgba(0, 230, 231, .2)',
           type: 'dashed'
         }
       },
       axisLine: {
         lineStyle: {
           color: '#0EBAB3'
         }
       },
       axisLabel: {
         interval: 0
       },
       axisTick: {
         show: true,
         inside: true
       },
       data: ['a', 'b', 'c', 'd', 'e', 'f', 'g']
     },
     xAxis: {
       interval: 1,
       splitLine: {
         show: true,
         lineStyle: {
           color: 'rgba(0, 230, 231, .2)',
           type: 'dashed'
         },
         color: function (params, index) {
           let colorList = ['#163EC0', '#2058BF', '#2374CF', '#2272AF', '#318DC1'];
           return colorList[index];
         }
       },
       axisLine: {
         show: true,
         lineStyle: {
           color: '#0EBAB3'
         }
       },
       min: 0,
       max: 4,
       axisLabel: {
         formatter: function (value) {
           let texts = [];
           if (value == 0) {
             texts.push('风险值');
           } else if (value <= 1) {
             texts.push('低风险');
           } else if (value <= 2) {
             texts.push('一般风险');
           } else if (value <= 3) {
             texts.push('较大风险');
           } else {
             texts.push('重大风险');
           }
           return texts;
         },
         color: function (v) {
           if (v == 0) {
             return '#ccc';
           } else if (v == 1) {
             return '#0180A7';
           } else if (v == 2) {
             return '#B39E0C';
           } else if (v == 3) {
             return '#B76C0A';
           } else {
             return '#AA2113';
           }
         }
       }
     },
     visualMap: {
       pieces: [
         // min-不包含, max-包含
         {
           min: 1,
           max: 1,
           label: '低风险',
           color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
             {
               offset: 1,
               color: 'rgba(1,128,167,0)'
             },
             {
               offset: 0,
               color: 'rgba(1,128,167,1)'
             }
           ])
         },
         {
           min: 2,
           max: 2,
           label: '一般风险',
           color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
             {
               offset: 1,
               color: 'rgba(179,158,12,0)'
             },
             {
               offset: 0,
               color: 'rgba(179,158,12,1)'
             }
           ])
         },
         {
           min: 3,
           max: 3,
           label: '较大风险',
           color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
             {
               offset: 1,
               color: 'rgba(183,108,10,0)'
             },
             {
               offset: 0,
               color: 'rgba(183,108,10,1)'
             }
           ])
         },
         {
           min: 4,
           max: 4,
           label: '重大风险',
           color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
             {
               offset: 1,
               color: 'rgba(170,33,19,0)'
             },
             {
               offset: 0,
               color: 'rgba(170,33,19,1)'
             }
           ])
         }
       ],
       outOfRange: {
         color: '#999'
       }
     },
     series: [
       {
         type: 'bar',
         barWidth: 40,
         data: [4, 3, 2, 1, 4, 3, 2],
         itemStyle: {
           normal: {
             barBorderRadius: 5,
             // color:"red"
           }
         }
       }
     ]
   };
   `


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] plainheart commented on issue #17396: [Feature] echarts横向柱状图根据不同数据展示不同颜色问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #17396:
URL: https://github.com/apache/echarts/issues/17396#issuecomment-1188636718

   See [this demo](https://echarts.apache.org/examples/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeBYAULWZjADaRAC5l1NMBnAC2AHdiAzAQ13IFNTYBfAGg4E8AggA8I5YqgxlyIXBDAAZCNFbiOZWFVrEwAJwCurXpPWzlAZTB9cKksfWwAxnmA7iAch0BzAEaMAFAAM3LAATADMQaFhAIzBAHQhAJRuRvZkliA2bgAmjFSs2W5qZJzFPMWMIuSKyqp2mKasFlY2EmmYTrgu7gDEAQCiAEICg2FF9VxlqWSVovKM3qy4dWlKYKw6AG7MxAFTFVUAKhAOANYr9pp0WPqGxZhK5BDZNroG-3a5YIzEANpujBSsD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YzqWApls2udjdrlfDC21eSAWtbSV2s5FnOYqJ43pdNgVohLsulYV5Wq4zhd2kd53Ed_d2wk9zdYHH38_cWPHDMclJfxD1gyfe8PI8u6PY-UePGHZpOudT4-m_ToTM_sbODYpZuyBNjwi7K8fogCbugnV6vb7ry-G-voJJeJqqB-7cwzP1fsrIIttq4Oydu2F2o9VywG3KPSeyC-qzwPMCByQdl6t1DuvKmokaZbwZkzHQrN96J2TifNO_MM7f3UFfcWN8AH31lsXIIYRn6lw_v3L-ACmGG3PvnXkwC5axk4dw3udt2IwP2nYFExRgB6DAAAeXoAAJUYNATw45uSt2Su1IxMiB5djYDoN6X06HqFdjKdwvgdBLwmA4gA6s8MAlAtz_wmF8H4X5txTyFMEMUATx6hEURMOQrAjRjkPGQaAJ5yQMNgA4wYLgXg6C0TdeCxAQy3z-oAwgAAiCs2QikuXbAdSQSJ0CcGLEAA) for your reference.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] hi-mashuo closed issue #17396: [Feature] echarts横向柱状图根据不同数据展示不同颜色问题

Posted by GitBox <gi...@apache.org>.
hi-mashuo closed issue #17396: [Feature] echarts横向柱状图根据不同数据展示不同颜色问题
URL: https://github.com/apache/echarts/issues/17396


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] echarts-bot[bot] commented on issue #17396: [Feature] echarts横向柱状图根据不同数据展示不同颜色问题

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

   @hi-mashuo It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Feature] echarts horizontal bar chart shows different color problems according to different data
   
   **BODY**
   
   ### What problem does this feature solve?
   
   Hello, I don't understand some functions of echarts, so I came to ask,
   I have implemented vertical columns to display different gradient colors according to different data. Now I need to change the vertical to horizontal. After the change, I found that the data is displayed in reverse and the colors are not displayed correctly. Please reply! Thanks! ! !
   
   ### What does the proposed API look like?
   
   none
   </details>


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] [echarts] hi-mashuo commented on issue #17396: [Feature]

Posted by GitBox <gi...@apache.org>.
hi-mashuo commented on issue #17396:
URL: https://github.com/apache/echarts/issues/17396#issuecomment-1187390578

   ![微信截图_20220718211212](https://user-images.githubusercontent.com/62926576/179518903-8d565d95-fe6a-4934-81f0-0b27c39d4752.png)
   之后


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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