uses ColumnWrapper and adds value labels on columns

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

No files matched your search

@@ -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 %}