{% extends "base.html" %}
{% block body %}
    
            {% block pietooltip %}
                chart.tooltipContent(function(key, y, e, graph) {
                    var x = String(key);
                    {{ chart.tooltip_condition_string }}
                    tooltip_str = '<center><b>'+x+'</b></center>' + y;
                    return tooltip_str;
                });
            {% endblock pietooltip %}

    {# showLabels only supported in pieChart #}
        chart.showLabels({{chart.show_labels|lower}});

        {% if chart.donut %}
            chart.donut(true);
            chart.donutRatio({{ chart.donutRatio }});
        {% else %}
            chart.donut(false);
        {% endif %}

{% block foot %}
{% if chart.color_list %}
        var mycolor = new Array();
    {% for color in chart.color_list %}
            mycolor[{{ loop.index - 1}}] = "{{ color }}";
    {% endfor %}
{% endif %}

        chart
            .x(function(d) { return d.label })
            .y(function(d) { return d.value });
{% if chart.width %}
        chart.width({{ chart.width }});
{% endif %}
{% if chart.height %}
        chart.height({{ chart.height }});
{% endif %}

{% if chart.color_list %}
        chart.color(mycolor);
{% endif %}
{% endblock foot %}

{% endblock body %}
