Skip to content

Instantly share code, notes, and snippets.

@adriatic
Last active July 19, 2016 18:49
Show Gist options
  • Save adriatic/f2751a3d97f52d53ef40d6488a5e7642 to your computer and use it in GitHub Desktop.
Save adriatic/f2751a3d97f52d53ef40d6488a5e7642 to your computer and use it in GitHub Desktop.
Bar chart: Multi axis
<template>
<ak-chart k-title.bind="{text: 'Hybrid car mileage report'}"
k-legend.bind="{position: 'top'}"
k-series.bind="series"
k-value-axis.bind="valueAxis"
k-category-axis.bind="categoryAxis">
</ak-chart>
</template>
export class MultiAxis {
series = [{
type: 'column',
data: [20, 40, 45, 30, 50],
stack: true,
name: 'on battery',
color: '#003c72'
}, {
type: 'column',
data: [20, 30, 35, 35, 40],
stack: true,
name: 'on gas',
color: '#0399d4'
}, {
type: 'line',
data: [30, 38, 40, 32, 42],
name: 'mpg',
color: '#642381',
axis: 'mpg'
}, {
type: 'line',
data: [7.8, 6.2, 5.9, 7.4, 5.6],
name: 'l/100 km',
color: '#e5388a',
axis: 'l100km'
}];
valueAxis = [{
title: { text: 'miles' },
min: 0,
max: 100
}, {
name: 'km',
title: { text: 'km' },
min: 0,
max: 161,
majorUnit: 32
}, {
name: 'mpg',
title: { text: 'miles per gallon' },
color: '#642381'
}, {
name: 'l100km',
title: { text: 'liters per 100km' },
color: '#e5388a'
}];
categoryAxis = {
categories: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
axisCrossingValues: [0, 0, 10, 10]
};
}
<!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