-
Notifications
You must be signed in to change notification settings - Fork 93
Embedding graphs and dashboards
Dieter Plaetinck edited this page Oct 9, 2013
·
2 revisions
The code below embeds html content in a page, containing 0 to N graphs depending on the query.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="/assets/js/jquery-1.7.2.js"></script>
<script src="/assets/js/bootstrap.js"></script>
</head>
<body>
<div class="well" id="test"></div>
<script lang="javascript">
$("#test").load("http://localhost:8080/graphs_minimal_deps/" + encodeURIComponent("plugin=carbon"));
</script>
</div>
</body>
</html>
Note:
- you should url encode any special characters in the URL.
- this file is in the repo under
assets/embed_example.html
and can be loaded underhttp://localhost:8080/assets/embed_example.html
- this is basically the same as what you'll find in
templates/snippet.graphs.minimal.tpl
which is what the GE dashboards use.