Skip to content

Instantly share code, notes, and snippets.

@adriatic
Last active July 19, 2016 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adriatic/16fbee66c21f9bc94f8b3be7342fddca to your computer and use it in GitHub Desktop.
Save adriatic/16fbee66c21f9bc94f8b3be7342fddca to your computer and use it in GitHub Desktop.
Area charts: stacked area
<template>
<ak-chart k-title.bind="{text: 'Browser Usage Trends'}"
k-legend.bind="{position: 'bottom'}"
k-series-defaults.bind="{type: 'area', stack: true}"
k-series.bind="series"
k-value-axis.bind="valueAxis"
k-category-axis.bind="categoryAxis"
k-tooltip.bind="tooltip">
</ak-chart>
</template>
export class StackedArea {
series = [{
name: 'Chrome',
data: [0, 0, 0, 0, 3.6, 9.8, 22.4, 34.6]
}, {
name: 'Firefox',
data: [0, 23.6, 29.9, 36.3, 44.4, 46.4, 43.5, 37.7]
}, {
name: 'Internet Explorer',
data: [76.2, 68.9, 60.6, 56.0, 46.0, 37.2, 27.5, 20.2]
}, {
name: 'Mozilla',
data: [16.5, 2.8, 2.5, 1.2, 0, 0, 0, 0]
}, {
name: 'Opera',
data: [1.6, 1.5, 1.5, 1.6, 2.4, 2.3, 2.2, 2.5]
}, {
name: 'Safari',
data: [0, 0, 0, 1.8, 2.7, 3.6, 3.8, 4.2]
}];
valueAxis = {
labels: {
format: '{0}%'
},
line: {
visible: false
},
axisCrossingValue: -10,
max: 100
};
categoryAxis = {
categories: [2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011],
majorGridLines: {
visible: false
}
};
tooltip = {
visible: true,
format: '{0}%',
template: '#= series.name #: #= value #%'
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.common.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.default.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.1.226/styles/kendo.mobile.all.min.css">
<script src="https://kendo.cdn.telerik.com/2016.1.226/js/jszip.min.js"></script>
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/0.3.5/config2.js"></script>
<!--<script src="./config2.js"></script>-->
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-kendoui-bridge', kendo => kendo.pro());
aurelia.start().then(a => a.setRoot());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment