Chart need refresh

37 views
Skip to first unread message

Tomáš Krsek

unread,
Oct 1, 2017, 2:24:55 PM10/1/17
to Google Visualization API
Daniel, please, i have little problem with charts, when i first retrieves page with chart, it show : (You called the draw ()method with the wrong type of data rather than a DataTable or DataView), when I do refresh of this page it show charts correctly.

Please where cab be the mistake - the code is
Thank you!

<script type="text/javascript" 


<script type='text/javascript'>
google.charts.load('current', {
  'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawChart);

function drawChart() {
var wrapper = new google.visualization.ChartWrapper(
{"containerId":"visualizationF27B","dataTable":{"cols":[{"id":"","label":"","pattern":"","type":"string","p":{}},{"id":"","label":"vymoženo CZK","pattern":"","type":"number","p":{}},{"id":"","label":"zbývá vymoci CZK","pattern":"","type":"number"}],"rows":[{"c":[{"v":"červenec","f":null},{"v":15,"f":null},{"v":44,"f":null}]}],"p":null},"options":{"isStacked":true,"animation":{"duration":2500,"startup":true},"bar":{"groupWidth": "25%"},"booleanRole":"certainty","hAxis":{"useFormatFromData":true,"viewWindow":{"max":null,"min":null},"minValue":null,"maxValue":null,"logScale":false,"gridlines":{"count":"3"}},"vAxes":[{"useFormatFromData":true,"minValue":null,"maxValue":null,"viewWindow":null,"viewWindowMode":null},{"useFormatFromData":true}],"legend":"bottom","series":{"1":{"color":"#b7b7b7"}},"title":"Celkový","fontName":"Georgia"},"state":{},"isDefaultVisualization":true,"chartType":"BarChart"}
);
wrapper.draw();
};
</script>
<div style='border: 0px darkgray solid;width:500px;'>
<div id='visualizationF27B' style='width:500px; height:200px;'></div>
</div>

Daniel LaLiberte

unread,
Oct 2, 2017, 12:12:50 AM10/2/17
to Google Visualization API
Your code seems to be working fine for me here:  https://jsfiddle.net/dlaliberte/6gL48fcL/  Does it work for you there?
Maybe your browser or plugins are causing some interference.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/09ee6b40-8769-46df-a20b-4f3fd606ffae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages