Skip to content

Instantly share code, notes, and snippets.

@ffullenk
Created June 12, 2014 00:20
Show Gist options
  • Save ffullenk/b19281a2dae5dca000ca to your computer and use it in GitHub Desktop.
Save ffullenk/b19281a2dae5dca000ca to your computer and use it in GitHub Desktop.
stacked horizontal bar chart dxChart
var dataSource = [
{ state: "Germany", young: 6.7, middle: 28.6, older: 5.1 }
];
$("#chartContainer").dxChart({
dataSource: dataSource,
rotated: true,
commonAxisSettings: {
label: { visible: false },
grid: { visible: false }
},
commonSeriesSettings: {
argumentField: "state",
type: "stackedBar"
},
series: [
{ valueField: "young", name: "0-14" },
{ valueField: "middle", name: "15-64" },
{ valueField: "older", name: "65 and older" }
],
argumentAxis: { visible: false },
legend: {
visible: false
},
tooltip: {
enabled: true,
customizeText: function () {
return this.seriesName + " years: " + this.valueText;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment