JavaScript
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer",
{
title:{
text: "Stacked column with 0"
},
data: [
{
type: "stackedColumn",
name: "Q1",
indexLabel:"#percent%",
yValueFormatString:"#",
indexLabelPlacement: "inside",
indexLabelFontColor: "white",
dataPoints: [
{ y: 15, label:"2006"},
{ y: 20, label:"2007"},
{ y: 30, label:"2008"},
{ y: 0, label:"2009"},
{ y: 50, label:"2010"},
{ y: 60, label:"2011"},
{ y: 70, label:"2012"}
]
},
{
type: "stackedColumn",
name: "Q2",
indexLabel:"#percent%",
yValueFormatString:"#",
indexLabelPlacement: "inside",
indexLabelFontColor: "white",
dataPoints: [
{ y: 15, label:"2006"},
{ y: 20, label:"2007"},
{ y: 30, label:"2008"},
{ y: 40, label:"2009"},
{ y: 0, label:"2010"},
{ y: 60, label:"2011"},
{ y: 70, label:"2012"}
]
},
{
type: "stackedColumn",
name: "Q3",
indexLabel:"#percent%",
yValueFormatString:"#",
indexLabelPlacement: "inside",
indexLabelFontColor: "white",
dataPoints: [
{ y: 15, label:"2006"},
{ y: 20, label:"2007"},
{ y: 30, label:"2008"},
{ y: 40, label:"2009"},
{ y: 50, label:"2010"},
{ y: 0, label:"2011"},
{ y: 70, label:"2012"}
]
},
{
type: "stackedColumn",
name:"Q4",
indexLabel:"#percent%",
yValueFormatString:"#",
indexLabelPlacement: "inside",
indexLabelFontColor: "white",
dataPoints: [
{ y: 15, label:"2006"},
{ y: 20, label:"2007"},
{ y: 0, label:"2008"},
{ y: 40, label:"2009"},
{ y: 50, label:"2010"},
{ y: 60,...