Fix tablesort when no pie - +indent
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %}
|
||||||
{% import '_macros.html' as macros %}
|
{% import '_macros.html' as macros %}
|
||||||
|
|
||||||
{% if render_graph %}
|
|
||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
|
{% if render_graph %}
|
||||||
var chart = null;
|
var chart = null;
|
||||||
var data = [
|
var data = [
|
||||||
{% for fact in facts|groupby('value') %}
|
{% for fact in facts|groupby('value') %}
|
||||||
@@ -22,19 +21,21 @@ var otherdata = fact_values.slice(15);
|
|||||||
if (otherdata.length > 0) {
|
if (otherdata.length > 0) {
|
||||||
realdata.push(["other", otherdata.reduce(function(a,b){return a + b[1];},0)]);
|
realdata.push(["other", otherdata.reduce(function(a,b){return a + b[1];},0)]);
|
||||||
}
|
}
|
||||||
|
{% endif %}
|
||||||
{% endblock javascript %}
|
{% endblock javascript %}
|
||||||
|
|
||||||
{% block onload_script %}
|
{% block onload_script %}
|
||||||
$('table').tablesort();
|
$('table').tablesort();
|
||||||
chart = c3.generate({
|
{% if render_graph %}
|
||||||
|
chart = c3.generate({
|
||||||
bindto: '#factChart',
|
bindto: '#factChart',
|
||||||
data: {
|
data: {
|
||||||
columns: realdata,
|
columns: realdata,
|
||||||
type : '{{config.GRAPH_TYPE|default('pie')}}',
|
type : '{{config.GRAPH_TYPE|default('pie')}}',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
{% endif %}
|
||||||
{% endblock onload_script %}
|
{% endblock onload_script %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="factChart" width="300" height="300"></div>
|
<div id="factChart" width="300" height="300"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user