basic example
by jlbriggs
HTML
<div id="container" style="height:400px;margin:1.5em 1em;"></div>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script>
//------------------------------------------------------
Highcharts.setOptions({
global: {
useUTC:false
},
chart: {
style: {
fontFamily: 'Abel,serif'
}
},
colors: [
'rgba( 0, 154, 253, 0.9 )', //bright blue
'rgba( 253, 0, 154, 0.9 )', //bright pink
'rgba( 154, 253, 0, 0.9 )', //bright green
'rgba( 253, 99, 0, 0.9 )', //bright orange
'rgba( 145, 44, 138, 0.9 )', //mid purple
'rgba( 45, 47, 238, 0.9 )', //mid blue
'rgba( 238, 46, 47, 0.9 )', //mid red
'rgba( 44, 145, 51, 0.9 )', //mid green
'rgba( 177, 69, 0, 0.9 )', //dark orange
'rgba( 103, 16, 192, 0.9 )' //dark purple
],
title: {
text: 'Sample Chart Title',
align:'left',
x:78,
margin:10,
style: {
fontWeight:'bold',
color:'rgba(0,0,0,.9)'
}
},
subtitle: {
text: 'Generic chart with random data generation for testing',
align:'left',
x:80
},
xAxis: {
title: {
text:'',
rotation:0,
textAlign:'center',
style:{
color:'rgba(0,0,0,.9)'
}
},
labels: {
style: {
color: 'rgba(0,0,0,.9)',
fontSize:'9px'
}
},
lineWidth : .5,
lineColor : '#333',
tickColor : '#333',
tickLength : 3,
tickWidth : .5,
gridLineWidth : 0,
gridLineColor : '#eee'
},
yAxis: {
title: {
text:'',
rotation:0,
textAlign:'right',
style:{
...
CSS
@import url(http://fonts.googleapis.com/css?family=Changa+One|Loved+by+the+King|Fredericka+the+Great|Droid+Serif:400,700,400italic|Abel|Oswald:400,300,700);
body {
font-family:Abel, Calibri, Helvetica, sans-serif;
font-size:95%;
}
JavaScript
var options = {
chart: {
type: 'column'
},
title: {
text: 'Period'
},
xAxis: {
categories: ['Cat 1', 'Cat 2']
},
yAxis: {
min: 0,
title: {
text: null
}
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: 'Dog',
color: '#f00',
data: [1,1.45]
},{
name: 'Cow',
color:'#ccc',
data: [2,5]
},{
name: 'Bird',
color:'#bbb',
data: [3,3.45]
}]
};
var chart = $('#container').highcharts(options);