ng-xCharts is a directive that allows you to add xCharts(http://tenxer.github.io/xcharts/) to your angular app
-
Install ng-xCharts and d3 using bower
-
Add xCharts style
<link rel="stylesheet" href="bower_components/ng-xCharts/xcharts.min.css"/>
-
Add xCharts.js and ng-xCharts.js
<script type="text/javascript" src="bower_components/d3/d3.min.js"></script><script type="text/javascript" src="bower_components/ng-xCharts/xcharts.min.js"></script><script type="text/javascript" src="bower_components/ng-xCharts/ng-xCharts.js"></script> -
Add ng-xCharts module to your angular app
-
Add data, type and opts that should be available in controller scope
<xchart id='myChart' style="height: 300px;" data="data" type="type" opts="opts"></xchart>
Note: more documentation about the data format can be found at: http://tenxer.github.io/xcharts/