I am using dangle.js, a visualization tool built for Angular JS based on D3. I am trying to output a graph by calling the directive with the html
<fs-area bind="data" on-click="filterByDate" />
In my controller I have the code
$scope.data = [
{x: 1, y: 100},
{x: 2, y: 20},
{x: 3, y: 43}
];
However, the graph is not showing, probably because I'm not sure how the directive expects the data to be given. I'm new to D3, can anyone point me in the right direction or give me an example dataset that would display in the graph? Thanks. Dangle.js docs aren't very helpful http://www.fullscale.co/dangle/
fs-area expects data to be present in a sub-field entries and the x and y accessors to be time and count respectively. Hence, this should work:
$scope.data = {
entries: [
{time: 1, count: 100},
{time: 2, count: 20},
{time: 3, count: 43}
]
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With