汤姆熊猫

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

excanvas拓扑,增加组拖拽和label功能

基于excanvas和jquery的拓扑功能

 

 http://chaoran.iteye.com/blog/623728

 

 https://files.cnblogs.com/tompandas/exCanvas.js

 

调用js

$(document).ready(function(){
    $("#container").jvChart(300, 200);
    var v1 = $("#container").insertEllipse(10, 120, 80, 40, '椭圆');
        var s = {};
        s[jvConstants.STYLE_STROKECOLOR] = '#A0C88F';
        v1.setStyle(s);
    var v2 = $("#container").insertRectangle(100, 20, 80, 40, 10, '矩形');
    v2.setLabelLocation(jvConstants.LABEL_LOCATION_MIDDLE);
    var v4 = $("#container").insertEllipse(200, 100, 50, 50);
    
    var v3 = $("#container").insertRectangle(150, 180, 60, 40, 2);

     
    
    $("#container").insertEdge(v1, v2);
    $("#container").insertEdge(v2, v3);
    $("#container").insertEdge(v2, v4);/**/


});

container是一个div:

<div id="container" style="width:640px; height:400px; background-color:rgb(255,255,255); background-image:url('images/graph/grid.gif')"></div>

 

 

 

posted on 2012-03-27 17:23  汤姆熊猫  阅读(128)  评论(0)    收藏  举报