• Demos
    • JavaScript Charts
    • JavaScript StockCharts
  • Download/NPM
    • Download CanvasJS
    • Install via NPM
  • Integrations
    Front End Technology Samples
    • React Charts
    • Angular Charts
    • Vue.js Charts New!
    • jQuery Charts
    • Dashboards
    Server Side Technology Samples
    • PHP Charts
    • Python Charts New!
    • ASP.NET MVC Charts
    • Spring MVC Charts
    • JSP Charts
  • License
  • Blog
  • Docs
    • Chart Documentation
    • StockChart Documentation
  • Support Forum
    • Chart Support
    • StockChart Support
  • My Account
My Account
  • KEY FEATURES
    • Chart with Index Label
    • Multi Series Chart
    • Chart with Zooming & Panning
    • Synchronized Charts
    • Chart with Animation
    • Chart With Image Overlay
    • Chart with Secondary Axis
    • Chart with Null Data
    • Chart with Dynamic Data
    • Column Chart with Reversed Axis
    • Chart with Logarithmic Axis
    • Chart using JSON Data
    • Performance With 50,000 Data Points
    • Draggable Column Chart
    • Chart with Axis / Scale Break
    • Chart with Crosshair
    • Chart with Customized Legends
    • Drilldown Chart
    • Responsive Chart
    • Chart with Axis Labels & Ticks inside Plot Area
    • Sync ToolTip across Multiple Charts
  • LINE CHARTS
    • Line Chart
    • Dashed Line Chart
    • Multi Series Line Chart
    • Line Chart with Zoom and Pan
    • Line Chart with Data Marker
    • Line Chart with Logarithmic Axis
    • Line Chart with Axis / Scale Break
    • Line Chart with Multiple Axes
    • Spline Chart
    • Multi Series Spline Chart
    • Dynamic Spline Chart
    • Spline Chart with Secondary Axis
    • Spline Chart with Legends
    • Step Line Chart
    • Multi Series Step Line Chart with Null Data
  • AREA CHARTS
    • Area Chart
    • Multi Series Area Charts
    • Spline Area Chart
    • Multi Series Spline Area Charts
    • Step Area Chart
    • Range Area Chart
    • Multi Series Range Area Charts
    • Range Spline Area Chart
    • Stacked Area Chart
    • Stacked Area 100% Chart
    • Stacked Area 100% Chart with Date-Time Axis
  • COLUMN & BAR CHARTS
    • Column Chart
    • Column Charts with Multiple Axes
    • Bar Chart
    • Multi Series Bar Chart
    • Bar Chart with Axis / Scale Break
    • Range Column Chart
    • Multi Series Range Column Chart
    • Stacked Column Chart
    • Stacked Column 100% Chart
    • Range Bar Chart
    • Stacked Bar Chart
    • Stacked Bar 100% Chart
    • Waterfall Chart
    • Multi Series Waterfall Chart
    • Waterfall Chart with Custom Colors
  • PIE & FUNNEL CHARTS
    • Pie Chart
    • Pie Chart with Legends
    • Pie Chart with Custom Radius
    • Doughnut Chart
    • Doughnut Chart with Custom Inner Radius
    • Funnel Chart
    • Funnel Chart with Custom Neck
    • Inverted Funnel Chart
    • Pyramid Chart
    • Pyramid Chart with Values represented by Area
    • Pyramid Chart With Index Labels Placed Inside
  • FINANCIAL CHARTS
    • Candlestick Chart
    • Multi Series Candlestick Chart
    • Combination of Candlestick & Line Chart
    • OHLC Chart
    • OHLC Chart from JSON Data using AJAX
  • SCATTER & BUBBLE CHARTS
    • Scatter / Point Chart
    • Multi Series Scatter / Point Chart
    • Scatter Chart with Custom Markers
    • Bubble Chart
    • Bubble Chart with Zoom & Pan
    • Bubble Chart with Custom Markers
  • BOX & WHISKER CHARTS
    • Box And Whisker Chart
    • Box and Whisker Chart with Color Customization
    • Box And Whisker Chart with Outliers
  • COMBINATION CHARTS
    • Error Chart
    • Error Line Chart
    • Error Bar Chart
    • Pareto Chart
    • Pareto Chart with Index / Data Label
    • Combination of Range Area and Line Charts
    • Combination of Column, Line and Area Chart
    • Combination of OHLC and Line Chart
  • DYNAMIC CHARTS
    • Dynamic / Live Column Chart
    • Dynamic / Live Line Chart
    • Dynamic / Live Multi Series Chart
  • ANGULAR, REACT, VUE.JS, JQUERY
    • Angular Charts
    • React Charts
    • Vue.js Charts
    • jQuery Charts
  • SERVER SIDE TECHNOLOGIES
    • ASP.NET MVC Charts
    • PHP Charts
    • Python Charts
    • JSP Charts
    • Spring MVC Charts

JavaScript Stacked Column Charts & Graphs

Download JavaScript Chart Samples
  • JavaScript Chart Samples
  • React Chart Samples
  • Angular Chart Samples
  • Vue.js Chart Samples
  • jQuery Chart Samples
  • PHP Chart Samples
  • Python Django Chart Samples
  • ASP.NET Chart Samples
  • JSP Chart Samples
  • Spring MVC Chart Samples
  • Dashboard Samples
  • JavaScript StockChart Samples

JavaScript Stacked Column Chart, also referred to as Vertical Stacked Bar Chart is formed by stacking multiple data-series, one on top of the other. Stacked Column Graphs show relation between individual values to the total sum. Charts are interactive, support animation, zooming, panning & exporting as image. Given example shows JavaScript Stacked Column Chart along with HTML source code that you can edit in-browser or save to run it locally.

Try Editing The Code

Download Copy JSFiddle
window.onload = function () {

var chart = new CanvasJS.Chart("chartContainer", {
	animationEnabled: true,
	title:{
		text: "Google - Consolidated Quarterly Revenue",
		fontFamily: "arial black",
		fontColor: "#695A42"
	},
	axisX: {
		interval: 1,
		intervalType: "year"
	},
	axisY:{
		valueFormatString:"$#0bn",
		gridColor: "#B6B1A8",
		tickColor: "#B6B1A8"
	},
	toolTip: {
		shared: true,
		content: toolTipContent
	},
	data: [{
		type: "stackedColumn",
		showInLegend: true,
		color: "#696661",
		name: "Q1",
		dataPoints: [
			{ y: 6.75, x: new Date(2010,0) },
			{ y: 8.57, x: new Date(2011,0) },
			{ y: 10.64, x: new Date(2012,0) },
			{ y: 13.97, x: new Date(2013,0) },
			{ y: 15.42, x: new Date(2014,0) },
			{ y: 17.26, x: new Date(2015,0) },
			{ y: 20.26, x: new Date(2016,0) }
		]
		},
		{        
			type: "stackedColumn",
			showInLegend: true,
			name: "Q2",
			color: "#EDCA93",
			dataPoints: [
				{ y: 6.82, x: new Date(2010,0) },
				{ y: 9.02, x: new Date(2011,0) },
				{ y: 11.80, x: new Date(2012,0) },
				{ y: 14.11, x: new Date(2013,0) },
				{ y: 15.96, x: new Date(2014,0) },
				{ y: 17.73, x: new Date(2015,0) },
				{ y: 21.5, x: new Date(2016,0) }
			]
		},
		{        
			type: "stackedColumn",
			showInLegend: true,
			name: "Q3",
			color: "#695A42",
			dataPoints: [
				{ y: 7.28, x: new Date(2010,0) },
				{ y: 9.72, x: new Date(2011,0) },
				{ y: 13.30, x: new Date(2012,0) },
				{ y: 14.9, x: new Date(2013,0) },
				{ y: 18.10, x: new Date(2014,0) },
				{ y: 18.68, x: new Date(2015,0) },
				{ y: 22.45, x: new Date(2016,0) }
			]
		},
		{        
			type: "stackedColumn",
			showInLegend: true,
			name: "Q4",
			color: "#B6B1A8",
			dataPoints: [
				{ y: 8.44, x: new Date(2010,0) },
				{ y: 10.58, x: new Date(2011,0) },
				{ y: 14.41, x: new Date(2012,0) },
				{ y: 16.86, x: new Date(2013,0) },
				{ y: 10.64, x: new Date(2014,0) },
				{ y: 21.32, x: new Date(2015,0) },
				{ y: 26.06, x: new Date(2016,0) }
			]
	}]
});
chart.render();

function toolTipContent(e) {
	var str = "";
	var total = 0;
	var str2, str3;
	for (var i = 0; i < e.entries.length; i++){
		var  str1 = "<span style= \"color:"+e.entries[i].dataSeries.color + "\"> "+e.entries[i].dataSeries.name+"</span>: $<strong>"+e.entries[i].dataPoint.y+"</strong>bn<br/>";
		total = e.entries[i].dataPoint.y + total;
		str = str.concat(str1);
	}
	str2 = "<span style = \"color:DodgerBlue;\"><strong>"+(e.entries[0].dataPoint.x).getFullYear()+"</strong></span><br/>";
	total = Math.round(total * 100) / 100;
	str3 = "<span style = \"color:Tomato\">Total:</span><strong> $"+total+"</strong>bn<br/>";
	return (str2.concat(str)).concat(str3);
}

}                                

Chart Customizations

You can enable legends by setting showInLegend to true. Legends increase the readability of the chart. Some other common customizations include setting color, dataPointWidth, etc.

Quick Links

  • Chart Docs
  • StockChart Docs
  • About Us
  • FAQs

Server Side Technologies

  • ASP.NET MVC Charts
  • PHP Charts
  • JSP Charts
  • Spring MVC Charts

Front Side Technologies

  • JavaScript Charts
  • jQuery Charts
  • React Charts
  • Angular Charts
  • JavaScript StockCharts

Contact

  • Fenopix, Inc.
  • 2093 Philadelphia Pike,
  • #5678, Claymont,
  • Delaware 19703
  • United States Of America

©2025 Fenopix Privacy Policy Cookies Policy Careers