{% extends "base.html" %} {% block container %} {% if chart.display_container %} {{ chart.container }} {% endif %} {% endblock container %} {% block body %} {% block data %} data_{{ chart.name }}={{ chart.series_js }}; {% endblock data %} {% block init %} nv.addGraph(function() { var chart = nv.models.{{ chart.model }}(){% if chart.use_interactive_guideline %}.useInteractiveGuideline(true){% endif %}; chart.margin({top: {{ chart.margin_top }}, right: {{ chart.margin_right }}, bottom: {{ chart.margin_bottom }}, left: {{ chart.margin_left }}}); var datum = data_{{ chart.name }}; {% if not chart.color_list and chart.color_category %} chart.color(d3.scale.{{ chart.color_category }}().range()); {% endif %} {% endblock init %} {% if chart.stacked %} chart.stacked(true); {% endif %} {% if chart.focus_enable %} chart.focusEnable(true); {% endif %} {% block axes %} {% for axis, a in chart.axislist.items() %} {% if a.items() %} chart.{{ axis }} {% for attr, value in a.items() %} .{{ attr}}({{ value}}){% if loop.last %}; {% endif %} {% endfor %} {% endif %} {% endfor %} {% endblock axes %} {# generate custom tooltip for the chart #} {% block tooltip %} {% if chart.custom_tooltip_flag %} {% if not chart.date_flag %} {% if chart.model == 'pieChart' %} {% block pietooltip %} {% endblock pietooltip %} {% else %} chart.tooltipContent(function(key, y, e, graph) { var x = String(graph.point.x); var y = String(graph.point.y); {{ chart.tooltip_condition_string }} tooltip_str = '