realeve commented on issue #13905:
URL: 
https://github.com/apache/incubator-echarts/issues/13905#issuecomment-752500485


   @plainheart 
   
在tooltip不注入额外的样式(背景,字号,文字颜色等)的情况下,设置className,最终的样式会被ECharts的style所覆盖,最终这项功能基本没法使用,除非
 强制设定为  !important  ,这样就没意义了。
   
   
![image](https://user-images.githubusercontent.com/448208/103350594-779cf380-4adb-11eb-8e41-30ceda8fc1b8.png)
   
   ## 测试用例: 
https://echarts.apache.org/next/examples/zh/editor.html?c=line-simple
   
   ```js
   
   var style=`.echarts-tooltip {  
     background-color: rgba(48, 54, 64, 0.8);
     color: rgb(224, 224, 227);
     font-size: 12px ;
     line-height: 18px;
     font-family:  'Unica One', -apple-system, 'Segoe UI', Roboto, 'Helvetica 
Neue', Arial,
       'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe 
UI Symbol',
       'Noto Color Emoji';
     padding: 12px;
     box-shadow: rgba(0, 0, 0, 0.5) 0px 2px 4px;
     border-radius: 3px;
     border: none; 
     backdrop-filter: saturate(180%) blur(20px);
   }
   `;
   
   /* 注入style  */
   const appendStyle = (style)=>{ 
       var ele=document.createElement("style");
       ele.innerHTML=style;
       document.getElementsByTagName('head')[0].appendChild(ele)
   }
   
   appendStyle(style); 
   
   option = {
       xAxis: {
           type: 'category',
           data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
       },
       yAxis: {
           type: 'value'
       },
       series: [{
           data: [150, 230, 224, 218, 135, 147, 260],
           type: 'line'
       }],
       tooltip:{
           className:'echarts-tooltip'
       }
   }; 
   ```
   
   


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



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

Reply via email to