Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<html>
<head>
<title>Highcharts Tutorial</title>
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
<script src = "https://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div id = "container" style = "width: 100%; height: 600px; margin: 0 auto"></div>
<script language = "JavaScript">
$(document).ready(function() {
var chart = {
type: 'bar'
};
var title = {
text: 'Numero di campioni per classe Dana di I livello'
};
var subtitle = {
text: 'lorem ipsum'
};
var xAxis = {
categories: ['Tektosilicates','Oxides and Hydroxides','Carbonates, Nitrates, Borates','Sulfides','Nesosilicates','Phosphates, Arsenates, Vanadates','Phyllosilicates','Sulfates, Chromates, Selenates','Inosilicates','Sorosilicates','Halides','Cyclosilicates','Native Elements','Organic Minerals','Not Classified Silicates'],
title: {
text: null
}
};
var yAxis = {
min: 0,
title: {
text: 'numero di campioni',
align: 'high'
},
labels: {
overflow: 'justify'
}
};
var tooltip = {
valueSuffix: ''
};
var plotOptions = {
bar: {
dataLabels: {
enabled: true
}
}
};
var legend = {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: (
(Highcharts.theme && Highcharts.theme.legendBackgroundColor) ||
'#FFFFFF'),
shadow: true
};
var credits = {
enabled: false
};
var series = [
{
name: 'Classe',
data: [522,354,333,313,249,210,203,194,157,106,92,91,69,32,1]
}
];
var json = {};
json.chart = chart;
json.title = title;
json.subtitle = subtitle;
json.tooltip = tooltip;
json.xAxis = xAxis;
json.yAxis = yAxis;
json.series = series;
json.plotOptions = plotOptions;
json.legend = legend;
json.credits = credits;
$('#container').highcharts(json);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment