Clone via git and use dist/index.js
git clone https://github.com/freespee/fs-widgets
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="/node_modules/Chart.min.js"></script>
<script src="/node_modules/angular-chart.min.js"></script>
let app = angular.module('app', ['fs-widgets']);
Add your dataurl that points to a proxy as shown below.
customerId, fromDate and toDate are optional parameters that can be passed in to globally filter widgets.
let app = angular.module('app', ['fs-widgets']);
app.config(function(FsDataProvider) {
FsDataProvider.customerId = 300033;
FsDataProvider.fromDate = '2017-07-01';
FsDataProvider.toDate = '2017-08-01';
FsDataProvider.dataUrl = '/data?type={{type}}&customer_id={{customerId}}&from_date={{fromDate}}&to_date={{toDate}}';
FsDataProvider.baseUrl = 'http://localhost:3000';
FsDataProvider.dateFormat = 'YYYY-MM-DD'; // Optional. Default: 'YYYY-MM-DD'. See [momentjs](https://momentjs.com/docs/#/parsing/string-format) for a complete list of date formatting tokens.
});
<fs-line-chart type="calls_per_day">
</fs-line-chart>
The only attribute required is type. That tells the diretive wich data to display.
You can optionally pass title to specify the header of thw widget, and segments to target specific segments of your visitors.
Translations to the series name can be configure via translations. In the case of call_events_per_day two series will be displayed, answered and missed. To override those you can pass an array of objects that looks like this.
$scope.myTranslations = [
{serieName: 'answered', translation: 'Antworten'},
{serieName: 'missed', translation: 'Verpasste'}
]
<fs-line-chart
title="Calls per day"
type="calls_per_day"
fs-translations="myTranslations">
</fs-line-chart>
- call_length_distribution
- calls_per_day
- calls_top_attributions
- daily_call_distribution
- geographic_origin
- top_customers_by_calls
- average_calls_per_user
- call_durations
- call_totals
- missed_calls
- unique_callers