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 2021/09/02 10:39:31 UTC

[GitHub] [echarts] eeeqxxtg commented on issue #15654: Prevent overlapping elements

eeeqxxtg commented on issue #15654:
URL: https://github.com/apache/echarts/issues/15654#issuecomment-911519853


   scatter data label 
   
   ```html
   <div id="container" style="width: 640px; height: 400px"></div>
   ```
   
   ```js
   option = {
     tooltip: {
       trigger: 'item',
       borderWidth: 0
     },
     legend: { show: true, bottom: 0, itemHeight: 8, itemWidth: 8 },
     grid: { left: 16, right: 32, top: 32, bottom: 32, containLabel: true },
     yAxis: {
       type: 'value',
       axisLine: { show: true, onZero: false },
       splitLine: { show: false },
       axisTick: { show: true }
     },
     xAxis: {
       type: 'value',
       axisLine: { onZero: false },
       splitLine: { show: false },
       axisTick: { show: true }
     },
     series: [
       {
         type: 'scatter',
         name: '2021-06-15',
         symbolSize: 8,
         data: [
           {
             value: [0.41, 0.49],
             name: '林业'
           },
           {
             value: [0.97, 0.96],
             name: '农产品加工'
           },
           {
             value: [0.66, 0.69],
             name: '农业综合'
           },
           {
             value: [0.39, 0.55],
             name: '饲料'
           },
           {
             value: [0.31, 0.18],
             name: '渔业'
           },
           {
             value: [0.67, 0.69],
             name: '种植业'
           },
           {
             value: [0.92, 0.96],
             name: '畜禽养殖'
           },
           {
             value: [0.33, 0.44],
             name: '动物保健'
           }
         ],
         label: {
           position: 'right',
           show: true,
           formatter: params => params.name
         },
         labelLayout: { hideOverlap: true, dy: 10 }
       }
     ]
   };
   ```
   ![image](https://user-images.githubusercontent.com/24287188/131829387-2bad56f1-20f2-45c5-80bc-f0d2a210d6d8.png)
   
   codepen: https://codepen.io/eeeqxxtg/pen/WNOxbEm


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