Created
November 21, 2012 22:47
-
-
Save ismaild/4128351 to your computer and use it in GitHub Desktop.
My App Code
This file contains hidden or 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
| charts_dict = { | |
| 'inactivity': { | |
| 'title': 'Inactivity Aging Summary' , | |
| 'url': 'inactivity.json', | |
| 'container': 'inactivity', | |
| 'width': '100%', | |
| 'height': '250' | |
| } | |
| } | |
| @app.route('/dashboard') | |
| def dashboard(): | |
| return render_template('dashboard.html', charts=charts_dict) |
This file contains hidden or 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
| {% macro render(title, url, container, width='100%', height='100%') -%} | |
| <div class="box-header"> | |
| <h2>{{ title }}</h2> | |
| </div> | |
| <div class="box-content" id="{{ container }}"> | |
| Loading Graph | |
| <script type="text/javascript"><!-- | |
| var myChart = new FusionCharts( "/static/charts/Column2D.swf","my{{ container }}", "{{ width }}%", "{{ height }}", "0", "1" ); | |
| myChart.setJSONUrl("/static/data/{{ url }}"); | |
| myChart.setTransparent(true); | |
| myChart.render("{{ container }}"); | |
| // --> | |
| </script> | |
| </div> | |
| {%- endmacro %} |
This file contains hidden or 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
| {% import 'macros/chart_render.html' as chart %} | |
| {{ chart.render('Inactivity' ,'inactivity.json', 'inactivity', height='250') }} | |
| {% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment