Hello,
Im trying to create basic chart , using Google Chart embedded in the HTML element. But from what ever reason its doesn’t appear in the preview. (Although if im using JSfiddle it does work)
The code is very basic code:(and based on template i found at the forum)
<html>
<head>
<script type="text/javascript">
var results = [];
var x = [5,7,8];
var y = [3,6,7];
results.push (['labelx', 'label y']);
for (i = 0; i < x.length; i++) {
results.push([parseInt(x[i]),parseInt(y[i])]);
}
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable(results);
var options = {
title: 'test',
curveType: 'function',
hAxis:{title:'date'},
vAxis:{title:20,minValue:0},
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="curve_chart" style="width: 600px; height: 400px;"></div>
</body>
</html>"
Any help will be highly appricated