Skip to content

Instantly share code, notes, and snippets.

@stormpython
Created April 2, 2014 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stormpython/9935837 to your computer and use it in GitHub Desktop.
Save stormpython/9935837 to your computer and use it in GitHub Desktop.
Link Function
define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var k4 = require('K4D3');
var app = require('modules').get('app/discover');
app.directive('discoverTimechart', function ($compile) {
return {
restrict: 'E',
scope : {
data: '='
},
link: function ($scope, elem) {
var init = function () {
// This elem should already have a height/width
var myChart = new k4.Chart(elem[0], {type: 'histogram', yGroup: true, doSomething: true, draggable: false});
/*
myChart.on('hover', function (elem, event) {
})
*/
myChart.render($scope.data);
};
// Start the directive
init();
}
};
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment