fix some bugs in directives.js
charts in apriori