Created
April 2, 2014 14:53
-
-
Save stormpython/9935837 to your computer and use it in GitHub Desktop.
Link Function
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
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