mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 17:38:54 +00:00
paramaterized cohort visualization
This commit is contained in:
parent
6210d6ab80
commit
6bd7dc9237
@ -2,6 +2,12 @@
|
||||
var cohortVisualization = angular.module('redash.visualization');
|
||||
|
||||
cohortVisualization.config(['VisualizationProvider', function(VisualizationProvider) {
|
||||
|
||||
var editTemplate = '<cohort-editor2></cohort-editor2>';
|
||||
var defaultOptions = {
|
||||
timeInterval: 'daily'
|
||||
};
|
||||
|
||||
VisualizationProvider.registerVisualization({
|
||||
type: 'COHORT',
|
||||
name: 'Cohort',
|
||||
@ -49,13 +55,13 @@
|
||||
container: container,
|
||||
cohort: data,
|
||||
title: null,
|
||||
timeInterval: 'daily',
|
||||
timeInterval: $scope.timeInterval,
|
||||
labels: {
|
||||
time: 'Activation Day',
|
||||
time: 'Activation ' + $scope.timeLabel,
|
||||
people: 'Users'
|
||||
},
|
||||
formatHeaderLabel: function (i) {
|
||||
return "Day " + (i - 1);
|
||||
return $scope.timeLabel + (i - 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -64,4 +70,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
}());
|
||||
}());
|
||||
|
6
rd_ui/app/views/visualizations/cohort_editor2.html
Normal file
6
rd_ui/app/views/visualizations/cohort_editor2.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label">Time Interval (daily, weekly, monthly)</label>
|
||||
<input type="text" class="form-control" ng-model="cohortOptions.timeInterval">
|
||||
<label class="control-label">Time Label </label>
|
||||
<input type="text" class="form-control" ng-model="cohortOptions.timeLabel">
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user