Highcharts Demo
author(s):
Torstein Hønsi
HTML
<script src="https://code.highcharts.com/js/highcharts.js"></script>
<!--script src="https://code.highcharts.com/modules/exporting.js"></script-->
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
CSS
@import 'https://code.highcharts.com/css/highcharts.css';
[class^='highcharts-color-'], [class*=' highcharts-color-'] {
fill: #008000;
stroke: #004000;
}
.highcharts-negative {
fill: #800000;
stroke: #400000;
}
/* NB: !important necessary to override .highcharts-negative styling */
.highcharts-color-3 {
fill: #000080 !important;
stroke: #000040 !important;
}
JavaScript
var data = [107, -31, 635, -203, -2, 133, -156]
Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: 'BAR GRAPH'
},
xAxis: {
categories: ['ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN']
},
yAxis: {
labels: {
overflow: 'justify'
}
},
plotOptions: {
bar: {
colorByPoint: true,
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 80,
floating: true,
borderWidth: 1,
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
shadow: true
},
credits: {
enabled: false
},
series: [{
data: data
}]
});