uses ColumnWrapper and adds value labels on columns

This commit is contained in:
artus40
2018-03-07 17:08:18 +01:00
parent 7fdb7e9f31
commit 2f9b987d1f
2 changed files with 29 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
{% extends "graphos/gchart/base.html" %}
{% block create_chart %}
var chart_data = data;
var chart_div = document.getElementById('{{ chart.get_html_id }}');
var chart = new google.visualization.ColumnChart(chart_div);
var data = new google.visualization.DataView(chart_data);
data.setColumns([0, 1,
{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" },
]);
// Wait for the chart to finish drawing before calling the getImageURI() method.
google.visualization.events.addListener(chart, 'ready', function () {
$("#image-{{ chart.get_html_id }}").attr("href", chart.getImageURI());
});
{% endblock %}