Skip to content

Instantly share code, notes, and snippets.

@cdaniel77
Forked from adriatic/app.html
Last active June 2, 2016 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdaniel77/18666b1d7f86114bdd4da9c508f51747 to your computer and use it in GitHub Desktop.
Save cdaniel77/18666b1d7f86114bdd4da9c508f51747 to your computer and use it in GitHub Desktop.
Area charts: multi axis
<template>
<require from="./chart"></require>
<div style="position: absolute; width: 0; height: 0;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<pattern id="pattern1" width="4" height="4" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="1" style="stroke:black; stroke-width:2" />
</pattern>
</defs>
</svg>
</div>
<chart></chart>
</template>
export class MultiAxis {
}
<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 Chart {
series = [{
type: 'column',
data: [20, 40, 45, 30, 50],
stack: true,
name: 'on battery',
color: 'url(#pattern1)'
}, {
type: 'column',
data: [20, 30, 35, 35, 40],
stack: true,
name: 'on gas',
color: '#0399d4'
}, {
type: 'area',
data: [30, 38, 40, 32, 42],
name: 'mpg',
color: '#642381',
axis: 'mpg'
}, {
type: 'area',
data: [7.8, 6.2, 5.9, 7.4, 5.6],
name: 'l/100 km',
color: 'url(#pattern1)',
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