Last active
March 24, 2016 13:37
-
-
Save JeroenVinke/d0b9cee16968a7ccbf76 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {inject} from 'aurelia-framework'; | |
import {HttpClient} from 'aurelia-http-client'; | |
@inject(HttpClient) | |
export class BasicUse { | |
constructor(httpClient) { | |
this.httpClient = httpClient; | |
} | |
activate() { | |
this.buildStuff(); | |
this.seriesCategoryAxisSet(); | |
this.seriesDefaultsSet(); | |
this.seriesSet(); | |
this.seriesValueAxisSet(); | |
this.seriesTooltipSet(); | |
this.seriesCategoryAxisSet(); | |
} | |
buildStuff() { | |
this.datasource = new kendo.data.DataSource({ | |
transport: { | |
read: (options) => { | |
this.httpClient.get('./src/samples/chart/line-charts/basic-use.json') | |
.then((response) => JSON.parse(response.response).data) | |
.then(data => { | |
options.success(data); | |
}); | |
} | |
} | |
}); | |
} | |
seriesDefaultsSet(){ | |
return this.seriesDefaults= { | |
type: 'line', | |
labels: { | |
visible: true, | |
format: '{0}%', | |
background: 'transparent' | |
} | |
}; | |
} | |
seriesSet(){ | |
return this.series= [{ | |
field: 'Value', | |
name: 'Value' | |
}]; | |
} | |
seriesValueAxisSet(){ | |
return this.seriesValueAxis = { | |
labels: { | |
format: '{0}%' | |
}, | |
line: { | |
visible: false | |
} | |
}; | |
} | |
seriesCategoryAxisSet(){ | |
return this.seriesCategoryAxis = { | |
field: 'Timestamp', | |
majorGridLines: { | |
visible: false | |
} | |
}; | |
} | |
seriesTooltipSet(){ | |
return this.seriesTooltip = { | |
visible: false, | |
}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<ak-chart k-title.bind="{text: 'TEST'}" | |
k-data-source.bind="datasource" | |
k-legend.bind="{position: 'bottom'}" | |
k-series.bind="series" | |
k-series-defaults.bind="seriesDefaults" | |
k-series-axis.bind="seriesValueAxis" | |
k-category-axis.bind="seriesCategoryAxis" | |
k-tooltip.bind="seriesTooltip"> | |
</ak-chart> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment