flowChartJs is an example of chart plugin for Angular Flow Chart, using ChartJS via Angular Chart
Install via Bower
bower install angular-flow-chartjs --saveAdd script tag to your index.html
<script src="bower_components/angular-flow-chartjs.js"></script>Include the ngFlowChartJs module as a dependency to your module:
angular.module('app', ['ngFlowChartJs', 'ngFlowChart', 'flowthings'])Full example here
chartType:stringrepresenting one of chart types supported by ChartJS (line, bar, radar, pie, polar-area, doughnut)chartOptions: optionsobjectto be passed to ChartJS (check the official docs for more info)valueProperties:stringor anarray of stringseach representing a path to property of the data object to be used as graph value. If array is passed, a graph will be drawn for each path. Strings should be inpath.to.propformvalueDefaults:numberor anarray of numbersto be used as a default if the data point object doesn't contain property in the given path. Defaults tonull, resulting in graph points not being drawn. If a single value is passed, it will be used as default for all graphslabelProperty:stringorboolean. Ifstringis passed, it will be used as a path to a property of the data object to be used as label. It should be inpath.to.propform. Passingtruewill generate auto incremented labels, starting at 0. Passingfalsewill not display labelslabelDefault: used iflabelPropertyis passed.Numberrepresenting default label value if the data point object doesn't contain property in the given label pathseries,click,hover,legendandcoloursare directly passed to Angular Chart directive
<!-- main.html -->
<flow-chart flow-id="flowId" limit="20">
<flow-chart-js
value-properties="chart.valueProp"
value-defaults="chart.valueDefaults"
label-property="chart.labelProperty"
chart-type="line"
chart-options="chart.options"
series="chart.series"
legend="chart.legend">
</flow-chart-js>
</flow-chart>/* main.js */
angular.module('ngFlowThingsApp')
.controller('MainCtrl', function ($scope) {
$scope.flowId = '< your Flow ID >';
$scope.chart = {
options: {
animation: false
},
series: ['Inside Temperature', 'Outside Temperature'],
valueProp: ['inside.temperature', 'outside.temperature'],
/* or valueProp: 'inside.humidity' */
valueDefaults: 0,
/* or valueDefaults: [3, -7] */
labelProperty: 'datetime'
/* or labelProperty: true */
legend: true
}
});