Built with blockbuilder.org
Created
July 20, 2018 06:13
-
-
Save genesisbertiz/6b742d23cccd171b54f643bfe6125bf0 to your computer and use it in GitHub Desktop.
bar chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
</style> | |
</head> | |
<body> | |
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<script type="text/javascript"> | |
google.charts.load("current", {packages:["corechart"]}); | |
google.charts.setOnLoadCallback(drawChart); | |
function drawChart() { | |
var data = google.visualization.arrayToDataTable([ | |
["Element", "Density", { role: "style" } ], | |
["07-20-18", -8.94, ""], | |
["07-21-18", 10.49, ""], | |
["07-22-18", 19.30, ""], | |
["07-23-18", 21.45, ""] | |
]); | |
var view = new google.visualization.DataView(data); | |
view.setColumns([0, 1, | |
{ calc: "stringify", | |
sourceColumn: 1, | |
type: "string", | |
role: "annotation" }, | |
2]); | |
var options = { | |
title: "", | |
width: 600, | |
height: 400, | |
bar: {groupWidth: "95%"}, | |
legend: { position: "none" }, | |
}; | |
var chart = new google.visualization.BarChart(document.getElementById("barchart_values")); | |
chart.draw(view, options); | |
} | |
</script> | |
<div id="barchart_values" style="width: 900px; height: 300px;"></div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment