You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/05/22 08:28:56 UTC

[GitHub] [incubator-echarts] gelibin commented on issue #10517: 使用markline画分区域,导致拖拽很卡有办法优化吗

gelibin commented on issue #10517: 使用markline画分区域,导致拖拽很卡有办法优化吗
URL: https://github.com/apache/incubator-echarts/issues/10517#issuecomment-494706292
 
 
   @Ovilia series: [{
                   type: 'graph',
                   layout: 'force',
                   id:'a',
                   // coordinateSystem: 'cartesian2d',
                   coordinateSystem: 'cartesian2d',
                   edgeSymbol: ['',''],
                   // symbolSize: 20,
   //                force: {
   //                  repulsion: 1000,
   //                  edgeLength: [150, 200],
   //                  layoutAnimation: false
   //                },
                   label: {
                     normal: {
                       show: true,
                       position: 'bottom',
                       color: '#12b5d0'
                     }
                   },
                   lineStyle: {
                     normal: {
                       width: 2,
                       shadowColor: 'none'
                     }
                   },
                   xAxis: {
                     min: 0,
                     max: 100,
                     show: false,
                     type: 'value'
                   },
                   yAxis: {
                     min: 0,
                     max: 100,
                     show: false,
                     type: 'value'
                   },
                    //画虚线框-南北楼
                   markLine : {
                       symbol:'none',
                       lineStyle: {
                           normal: {
                               type: 'dashed',
                               color:'#3162B1',
                               opacity:1
                           },
                           
                       },
                       label:{
                         normal:{
                           position:'middle',
                           color: '#3576DB',
                           // formatter:function(params){
                           //     if(params.name){
                           //     var str =  params.name.replace(/(.{6})/g, '$1\n')
                           //     return str
                           //     }
                           // },
                         }
                       },
                       data : outsideCoords
                   },
                   // edgeSymbolSize: 8,
                   draggable:true,
                   data: this.charts.nodes,
                   links: this.charts.links,
                   z:9,
                   itemStyle: {
                     normal: {
                       label: {
                         show: true,
                         formatter: function(item) {
                           return item.data.name
                         }
                       }
                     }
                   }
                 }
                 , {
                   name: 'A',
                   id:'b',
                   type: 'lines',
                   coordinateSystem: 'cartesian2d',
                   // edgeSymbol: ['circle', 'arrow'],
                   // effect: {
                   //   show: true,
                   //   trailLength: 0,
                   //   // constantSpeed: 30,
                   //   symbol: 'arrow',
                   //   color: '#12b5d0',
                   //   // color:'#FF0000',
                   //   symbolSize: 8
                   // },
                   // data: this.charts.linesData,
                   z:9,
                   //画虚线框-内部
                   markLine : {
                       symbol:'none',
                       lineStyle: {
                           normal: {
                               type: 'solid',
                               color:'#3162B1',
                               opacity:1
                           },
                           
                       },
                       label:{
                         normal:{
                           position:'middle',
                           color: '#7BA4E3',
                           formatter:function(params){
                               if(params.name){
                               var str =  params.name.replace(/(.{6})/g, '$1\n')
                               return str
                               }
                           },
                         }
                       },
                       data : coords
                   },
                 }
                 ]
   markline的data值是:
   coords = [
       //每个框都按照左上右下的方式
             [
                 {
                     yAxis: 55,
                     xAxis: 0
                 },
                 {
                     yAxis: 100,
                     xAxis: 0
                 }
             ],
             [
                 {
                     yAxis: 100,
                     xAxis: 0
                 },
                 {
                     yAxis: 100,
                     xAxis: 100
                 }
             ],
             [
                 {
                     yAxis: 100,
                     xAxis: 100
                 },
                 {
                     yAxis: 55,
                     xAxis: 100
                 }
             ],
             [
                 {
                    name:'北楼',
                     yAxis: 55,
                     xAxis: 100
                 },
                 {
                     yAxis: 55,
                     xAxis: 0
                 }
             ]]

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org