forked from novus/nvd3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the tooltip translation fix to use the bounding rect of the first
element with a translation, if it exists.
- Loading branch information
1 parent
9bb0a88
commit 7aef287
Showing
2 changed files
with
72 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link href="../build/nv.d3.css" rel="stylesheet" type="text/css"> | ||
<script src="../bower_components/d3/d3.min.js" charset="utf-8"></script> | ||
<script src="../build/nv.d3.js"></script> | ||
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | ||
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h3>Noraml Example</h3> | ||
<div id="noraml-container"></div> | ||
|
||
<h3>Modal Example</h3> | ||
<div> | ||
<a href="#myModal" role="button" class="btn btn-default" data-toggle="modal">Launch Modal</a> | ||
</div> | ||
|
||
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true"> | ||
<div class="modal-dialog modal-lg modal-offset-top"> | ||
<div class="modal-content"> | ||
<div class="modal-body"> | ||
|
||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script> | ||
$(function(){ | ||
|
||
drawGraph('#noraml-container'); | ||
|
||
$('#myModal').on('shown.bs.modal', function () { | ||
drawGraph('#myModal .modal-body'); | ||
}); | ||
|
||
|
||
function drawGraph(containerSelector) { | ||
nv.addGraph(function() { | ||
var chart = nv.models.multiBarChart().useInteractiveGuideline(true); | ||
var values = [{x: 1, y: 8}, {x: 2, y: 5}, {x: 3, y: 10}]; | ||
var myData = [ { key: 'key', values: values } ]; | ||
|
||
$(containerSelector).html(''); | ||
d3.select(containerSelector).append('svg') | ||
.datum(myData) | ||
.call(chart); | ||
|
||
return chart; | ||
}); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |