From the official Google docs about Google Charts I see in the example "Density of Precious Metals, in g/cm^3" I can annotate the value of the bars at its end by adding
var view = new google.visualization.DataView(data); view.setColumns([0, 1, { calc: "stringify", sourceColumn: 1, type: "string", role: "annotation" }, 2]);
And then pass view at the draw() function.
My current code to display a bar is simple as:
<script> PocketQuery.chart('BarChart', { height: 700, chartArea: { height: '100%', width: '50%' } }); </script>
Hi Stefano,
Sorry for the late reply! In your case, you need to manipulate the data array for the charts. You can achieve this that way:
<script> (function() { // Create a new data table object in which the first row already contains // the table headers. var dataTable = [['col1', 'col2', {role: 'style'}]]; // Iterate through the PocketQuery result and add the values to the data table. You can do arbitrary manipulations with the data before. jQuery.each(PocketQuery.queryArray(), function(index, row) { dataTable.push([row.col1, row.col2, '#ccc']); }); PocketQuery.chart('AnnotationChart', {dataTable: dataTable}); }()); </script>
You should try around in your developer tools and the JS debugger to dig more into this surrounding. Let me know if you need further help!
Regards, Felix [Scandio]
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.