surveybuilder
Version:
Build surveys in the most advanced, flexable, and more moderated way, for all users to build and see.
56 lines (46 loc) • 1.38 kB
HTML
<html>
<head>
<script src="https://cdn.anychart.com/releases/8.9.0/js/anychart-base.min.js"></script>
<script src="https://cdn.anychart.com/releases/8.9.0/themes/dark_earth.min.js" type="text/javascript"></script>
<title>SurveyBuilder-BarChart</title>
</head>
<body>
<div id="container" stye="width:100:height:100%;"></div>
<script>
//Config
var graph = "bar";// Use bar/column
var Graphtitle = "" //Enter A title
var darkThemeChart = true;
anychart.onDocumentReady(function() {
// set the data
var data = {
header: ["Name", "Year"],
rows: [
["Bob", 1998],
["John", 2003],
["Annie", 2003],
["Fred", 1945],
]};
// create the chart
if(graph == "bar"){
var chart = anychart.bar();
}
if(graph == "column")
chart = anychart.column();
if(!darkThemeChart){
//Nothing here
}
if(darkThemeChart){
anychart.theme(anychart.themes.darkEarth);
}
// add the data
chart.data(data);
// set the chart title
chart.title(Graphtitle);
// draw
chart.container("container");
chart.draw();
});
</script>
</body>
</html>