使用mxGraph制作干线图

本文介绍如何利用mxGraph库来实现一个功能完善的干线图。通过实例展示mxGraph的用法,帮助读者掌握在项目中创建复杂图表的技术。
摘要由CSDN通过智能技术生成

使用mxGraph制作干线图

<html>
<head>
	<meta charset="utf-8">
	<title>干线图</title>

	<script type="text/javascript">
		mxBasePath = '../src';
	</script>

	<script type="text/javascript" src="../src/js/mxClient.js"></script>

	<script type="text/javascript">
		
		function main(container)
		{
    
			// Checks if the browser is supported
			if (!mxClient.isBrowserSupported())
			{
    
				// Displays an error message if the browser is not supported.
				mxUtils.error('Browser is not supported!', 200, false);
			}
			else
			{
    
				mxEvent.disableContextMenu(container);//禁用浏览器自带右键
				// Creates the graph inside the given container  在给定容器内创建图形
				var graph = new mxGraph(container);

				// Enables rubberband selection  鼠标框选
				new mxRubberband(graph);
				
				graph.setEnabled(false);//对图形进行拖拽拉伸等操作
				graph.setCellsMovable(false);//禁止拖拽流程图
				
				
				configureStylesheet(graph);
				
				graph.setTooltips(true);  //开启提示工具
				graph.setConnectable(true);
				// Installs a custom tooltip for cells
				graph.getTooltipForCell = function(cell)  //重写提示工具
				{
    
					if(this.model.isVertex(cell))
					{
    
						return 'rightclick';
					}
					
				}
				
				// Installs a
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值