-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xuebin Dong
committed
Nov 15, 2022
1 parent
27c60e4
commit ee5c46e
Showing
8 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Organization Chart Plugin</title> | ||
<link rel="icon" href="img/logo.png"> | ||
<link rel="stylesheet" href="css/jquery.orgchart.css"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
</head> | ||
<body> | ||
<div id="chart-container"></div> | ||
|
||
<script type="text/javascript" src="js/jquery.min.js"></script> | ||
<script type="text/javascript" src="js/jquery.orgchart.js"></script> | ||
<script type="text/javascript"> | ||
$(function() { | ||
|
||
var datasource = { | ||
'name': 'Lao Lao', | ||
'title': 'general manager', | ||
'children': [ | ||
{ 'name': 'Bo Miao', 'title': 'department manager', 'levelOffset': 1 }, | ||
{ 'name': 'Su Miao', 'title': 'department manager', | ||
'children': [ | ||
{ 'name': 'Tie Hua', 'title': 'senior engineer' }, | ||
{ 'name': 'Hei Hei', 'title': 'senior engineer', | ||
'children': [ | ||
{ 'name': 'Dan Dan', 'title': 'engineer' } | ||
] | ||
}, | ||
{ 'name': 'Pang Pang', 'title': 'senior engineer', 'levelOffset': 1 } | ||
] | ||
}, | ||
{ 'name': 'Hong Miao', 'title': 'department manager', 'levelOffset': 2 } | ||
] | ||
}; | ||
|
||
$('#chart-container').orgchart({ | ||
'data' : datasource, | ||
'nodeContent': 'title', | ||
'createNode': function(node, data) { | ||
if (data.levelOffset) { | ||
node.css({ | ||
'margin-top': (data.levelOffset * 70) + 'px', | ||
'--top': (-11 - data.levelOffset * 70) + 'px', | ||
'--height': (9 + data.levelOffset * 70) + 'px', | ||
'--top-cross-point': (-13 - data.levelOffset * 70) + 'px', | ||
'--height-cross-point': (11 + data.levelOffset * 70) + 'px' | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters