| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- {# This template adds attributes unique
- to lineChart #}
- {% extends "content.html" %}
- {% block body %}
- {% block data %}
- data_{{ chart.name }}={{ chart.series_js|striptags }};
- {% endblock data %}
- {% block init %}
- {{super()}}
- {% endblock init %}
- {% block rendering_opts %}
- {{super()}}
- {% endblock rendering_opts %}
- {% block axes %}
- {{super()}}
- {% endblock axes %}
- {% block tooltip %}
- {{super()}}
- {% endblock tooltip %}
- chart.showLegend({{chart.show_legend|lower}});
- {# add custom chart attributes #}
- {% for attr, value in chart.chart_attr.items() %}
- {% if value is string and value.startswith(".") %}:
- chart.{{ attr }}{{ value }};
- {% else %}
- chart.{{ attr }}({{ value }});
- {% endif %}
- {% endfor %}
- {% if chart.x_axis_format == 'AM_PM' %}
- function get_am_pm(d){
- if (d > 12) {
- d = d - 12; return (String(d) + 'PM');
- }
- else {
- return (String(d) + 'AM');
- }
- };
- {% else %}
- chart.x(function(d,i) { return i });
- {% endif %}
- {% if chart.resize %}
- nv.utils.windowResize(chart.update);
- {% endif %}
- {% block inject %}
- {{super()}}
- {% endblock inject %}
- {% block extras %}
- {{ super () }}
- {% endblock extras %}
- {% block close %}
- });
- {% endblock close %}
- {% endblock body %}
|