wenbinobject opened a new issue #9266: echarts 关于rich(富文本信息问题) 富文本命名 只能字符串和数字 
不能汉字。
URL: https://github.com/apache/incubator-echarts/issues/9266
 
 
   <!--
   http://echarts.baidu.com/examples/editor.html?c=bar-rich-text   官网实例 
把Sunny有关的都改为 ”奔驰“   发现不能实现对应的功能
   -->
   
   
   ### One-line summary [问题简述]
   http://echarts.baidu.com/examples/editor.html?c=bar-rich-text   官网实例 
把Sunny有关的都改为 ”奔驰“   发现不能实现对应的功能   只能通过axisLabel 下的 formatter 自定义方法 自己再写。
   
   
   
   
   
   
   
   
   
   
   ### Expected behaviour [期望结果]
   期望可以直接输入汉字达到预期效果,而不用 在formatter里面写自定义方法。
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   var weatherIcons = {
       '汉字': './data/asset/img/weather/sunny_128.png',
       'Cloudy': './data/asset/img/weather/cloudy_128.png',
       'Showers': './data/asset/img/weather/showers_128.png'
   };
   
   var seriesLabel = {
       normal: {
           show: true,
           textBorderColor: '#333',
           textBorderWidth: 2
       }
   }
   
   option = {
       title: {
           text: 'Wheater Statistics'
       },
       tooltip: {
           trigger: 'axis',
           axisPointer: {
               type: 'shadow'
           }
       },
       legend: {
           data: ['City Alpha', 'City Beta', 'City Gamma']
       },
       grid: {
           left: 100
       },
       toolbox: {
           show: true,
           feature: {
               saveAsImage: {}
           }
       },
       xAxis: {
           type: 'value',
           name: 'Days',
           axisLabel: {
               formatter: '{value}'
           }
       },
       yAxis: {
           type: 'category',
           inverse: true,
           data: ['汉字', 'Cloudy', 'Showers'],
           axisLabel: {
               formatter: function (value) {
                   return '{' + value + '| }\n{value|' + value + '}';
               },
               margin: 20,
               rich: {
                   value: {
                       lineHeight: 30,
                       align: 'center'
                   },
                   汉字: {
                       height: 40,
                       align: 'center',
                       backgroundColor: {
                           image: weatherIcons.汉字
                       }
                   },
                   Cloudy: {
                       height: 40,
                       align: 'center',
                       backgroundColor: {
                           image: weatherIcons.Cloudy
                       }
                   },
                   Showers: {
                       height: 40,
                       align: 'center',
                       backgroundColor: {
                           image: weatherIcons.Showers
                       }
                   }
               }
           }
       },
       series: [
           {
               name: 'City Alpha',
               type: 'bar',
               data: [165, 170, 30],
               label: seriesLabel,
               markPoint: {
                   symbolSize: 1,
                   symbolOffset: [0, '50%'],
                   label: {
                      normal: {
                           formatter: '{a|{a}\n}{b|{b} }{c|{c}}',
                           backgroundColor: 'rgb(242,242,242)',
                           borderColor: '#aaa',
                           borderWidth: 1,
                           borderRadius: 4,
                           padding: [4, 10],
                           lineHeight: 26,
                           // shadowBlur: 5,
                           // shadowColor: '#000',
                           // shadowOffsetX: 0,
                           // shadowOffsetY: 1,
                           position: 'right',
                           distance: 20,
                           rich: {
                               a: {
                                   align: 'center',
                                   color: '#fff',
                                   fontSize: 18,
                                   textShadowBlur: 2,
                                   textShadowColor: '#000',
                                   textShadowOffsetX: 0,
                                   textShadowOffsetY: 1,
                                   textBorderColor: '#333',
                                   textBorderWidth: 2
                               },
                               b: {
                                    color: '#333'
                               },
                               c: {
                                   color: '#ff8811',
                                   textBorderColor: '#000',
                                   textBorderWidth: 1,
                                   fontSize: 22
                               }
                           }
                      }
                   },
                   data: [
                       {type: 'max', name: 'max days: '},
                       {type: 'min', name: 'min days: '}
                   ]
               }
           },
           {
               name: 'City Beta',
               type: 'bar',
               label: seriesLabel,
               data: [150, 105, 110]
           },
           {
               name: 'City Gamma',
               type: 'bar',
               label: seriesLabel,
               data: [220, 82, 63]
           }
       ]
   };
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to