add doughnut chart
{% if doughnut_chart_data.labels and doughnut_chart_data.int_data %}
<h2>Distribution of top queries</h2>
- <canvas id="analytics-doughnut-last-7-days" width="400" height="150"></canvas>
+ <canvas id="analytics-doughnut-top-queries" width="400" height="150"></canvas>
{% endif %}
<br/>
{% block footerjs %}
+ {% if chart_data.labels and chart_data.int_data %}
// Line chart
var line_chart = document.getElementById("analytics-chart-last-7-days").getContext("2d");
var line_chart_labels = {{ chart_data.labels|safe }}
}
}
});
+ {% endif %}
+ {% if doughnut_chart_data.labels and doughnut_chart_data.int_data %}
// Doughnut chart
- var doughnut_chart = document.getElementById("analytics-doughnut-last-7-days").getContext("2d");
+ var doughnut_chart = document.getElementById("analytics-doughnut-top-queries").getContext("2d");
+ {{ doughnut_chart_data.labels|safe }}
var doughnut_labels = {{ doughnut_chart_data.labels|safe }};
var doughnut_data = {{ doughnut_chart_data.int_data|safe }};
colors = [
}
}
})
+ {% endif %}
{% endblock %}
