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/14 02:00:47 UTC

[GitHub] [echarts] zhaoyanga commented on issue #17369: 在小程序中使用echarts时,设置visualMap后,手指移动上去,线全部变成黑色了,在PC是正常

zhaoyanga commented on issue #17369:
URL: https://github.com/apache/echarts/issues/17369#issuecomment-1183869462

   `options:{
         title:{
           text:'岭澳出线潮流',
           left:'center',
           top:5
         },
         tooltip:{
           show:true,
           trigger:"axis",
           enterable:true,
           axisPointer:{
             animation:false
           },
           position: function(point, params, dom, rect, size){
             let x = point[0],
               y = point[1],
               viewWidth = size.viewSize[0],
               boxWidth = size.contentSize[0],
               posX = 0;
             if(x + boxWidth > viewWidth){
               posX = x - boxWidth;    
             }else{
               posX = x; 
             }
             return [posX,y];
           },
           label: {
             normal: {
               show: true
             }
           },
           formatter: function (params, ticket, callback) {
             let str = '';
             str += params[0]['name'];
             for (let i in params) {
               str += '\n';
               
               str += params[i]['seriesName'];
               str += ':'
               str += params[i]['value'][1]
             }
             return str;
           },
         },
         grid:{
           left:'5%',
           bottom:"10%",
           top:"15%",
           containLabel:true,
         },
         xAxis: {
           type:'category',
           data:[],
           axisLabel:{
               formatter:(val)=>{
                   if(val) {
                       let one = val.split(' ')
                       if(one.length > 1) {
                           return one[0]
                       } else {
                           return val
                       }
                   }
               },
           }
         },
         legend:{
           data:["2020", "2021", "2022"],
           width:'100%',
           bottom:0
         },
         yAxis:{
           type: "value",
           name: "单位:MW",
           nameTextStyle:{
             fontSize:14
           },
           min:0,
         },
         visualMap:[
   {
                     show:false,
                     precision:1,
                     pieces:[
                         {
                             gt:list[0] ? list[0].itemValue : 0,
                             color:'red'
                         },
                         {
                             gt:0,
                             lte:Number(list[0] ? list[0].itemValue : 0),
                         }
                     ],
                     seriesIndex:0
                 },
                 {
                     show:false,
                     pieces:[
                         {
                             gt:list[0] ? list[0].itemValue : 0,
                             color:'red'
                         },
                         {
                             gt:0,
                             lte:Number(list[0] ? list[0].itemValue : 0),
                             color:"#ec6c00"
                         }
                     ],
                     seriesIndex:1
                 },
   ],
         color:["rgba(0,170,232,1)","#ec6c00","rgba(0,120,170,1)"],
         series:[],
         dataZoom:[
           {
             type:"inside",
             show:true,
           }
         ]
       },`
   
   
   > 可以用微信开发创建一个代码片段吗?以便于复现和搜索者问题。
   
   


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