Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
Highcharts Stacked Bar Chart Example
Keywords : How to create stacked bar chart using highcharts, Stacked bar chart with example using highcharts, Highcharts stacked bar chart with examples
Example
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Highcharts Stacked bar chart</title> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script> <script type="text/javascript"> $(function () { var chartype = { type: 'bar' } var chartitle = { text: 'Stacked bar chart' } var chartxaxis = { categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'] } var chartyaxis = { min: 0, title: { text: 'Total fruit consumption' } } var chartlegend = { reversed: true } var chartplotoptions = { series: { stacking: 'normal' } } var chartseries = [{ name: 'John', data: [5, 3, 4, 7, 2] }, { name: 'Jane', data: [2, 2, 3, 2, 1] }, { name: 'Joe', data: [3, 4, 4, 2, 5] }] $('#container').highcharts({ chart:chartype, title: chartitle, xAxis:chartxaxis, yAxis: chartyaxis, legend: chartlegend, plotOptions: chartplotoptions, series: chartseries }); }); </script> </head> <body> <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> </body> </html>
Click Here to See Result
Result
Previous
Next