-
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
Showing
4 changed files
with
88 additions
and
6 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,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<title>Organization Chart Plugin</title> | ||
|
||
<link rel="icon" href="../img/logo.png" type="image/png"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | ||
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css"> | ||
<link rel="stylesheet" href="../css/style.css"> | ||
|
||
</head> | ||
<body> | ||
<button style="margin: 10px;" id="btn-chart1">chart 1</button> | ||
<button style="margin: 10px;" id="btn-chart2">chart 2</button> | ||
<button style="margin: 10px;" id="btn-chart3">chart 3</button> | ||
<div id="chart-container"></div> | ||
<div class="home-link"> | ||
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a> | ||
<img src="../img/logo.png"></img> | ||
</div> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> | ||
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script> | ||
<script type="text/javascript" src="scripts.js"></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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use strict'; | ||
|
||
(function($){ | ||
|
||
$(function() { | ||
|
||
var datasource = { | ||
'name': 'Lao Lao', | ||
'title': 'general manager', | ||
'children': [ | ||
{ 'name': 'Bo Miao', 'title': 'department manager' }, | ||
{ 'name': 'Su Miao', 'title': 'department manager' }, | ||
{ 'name': 'Yu Jie', 'title': 'department manager' }, | ||
{ 'name': 'Yu Li', 'title': 'department manager' }, | ||
{ 'name': 'Hong Miao', 'title': 'department manager' }, | ||
{ 'name': 'Yu Wei', 'title': 'department manager' }, | ||
{ 'name': 'Chun Miao', 'title': 'department manager' }, | ||
{ 'name': 'Yu Tie', 'title': 'department manager' } | ||
] | ||
}; | ||
|
||
var oc = $('#chart-container').orgchart({ | ||
'data' : datasource, | ||
'nodeContent': 'title' | ||
}); | ||
|
||
$('#btn-chart1').on('click', function (argument) { | ||
oc.init({ 'data': datasource }); | ||
}); | ||
|
||
$('#btn-chart2').on('click', function (argument) { | ||
var data = { 'name': 'Su Miao', 'title': 'department manager', | ||
'children': [ | ||
{ 'name': 'Tie Hua', 'title': 'senior engineer' }, | ||
{ 'name': 'Hei Hei', 'title': 'senior engineer' } | ||
] | ||
}; | ||
oc.init({ 'data': data }); | ||
}); | ||
|
||
$('#btn-chart3').on('click', function (argument) { | ||
var data = { 'name': 'Hei Hei', 'title': 'senior engineer', | ||
'children': [ | ||
{ 'name': 'Pang Pang', 'title': 'engineer' }, | ||
{ 'name': 'Dan Zai', 'title': 'UE engineer' }, | ||
{ 'name': '2Dan Zai', 'title': 'UE engineer' } | ||
] | ||
}; | ||
oc.init({ 'data': data }); | ||
}); | ||
|
||
}); | ||
|
||
})(jQuery); |