Created
May 5, 2016 16:03
-
-
Save rashidkpc/ccb1c95e63589fbb88c41680dd46f1ac to your computer and use it in GitHub Desktop.
Saving a template visualization from another app in Kibana
This file contains 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
function saveExpression(expression) { | |
savedVisualizations.get({type: 'timelion'}).then(function (savedExpression) { | |
savedExpression.id = expression; | |
savedExpression.visState.params = { | |
expression: expression, | |
interval: $scope.state.interval | |
}; | |
savedExpression.title = expression; | |
savedExpression.visState.title = expression; | |
savedExpression.save().then(function (id) { | |
if (id) notify.info('Saved expression as "' + savedExpression.title + '"'); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment