Skip to content

Commit d93c9a9

Browse files
committed
Use FC's JSON fetch rather than Angular's
Also fix another bug preventing width and height settings from not being respected
1 parent 91e9418 commit d93c9a9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/angular-fusioncharts.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,18 @@
5353
scope[attrs.fcChartObject] = chart;
5454
chart.render ();
5555
} else if(attrs.fcJsonUrl) {
56-
$http.get(attrs.fcJsonUrl)
57-
.success(function (data) {
58-
data.renderAt = element[0];
59-
chart = new FusionCharts(data);
60-
scope[attrs.fcChartObject] = chart;
61-
chart.render ();
62-
})
63-
.error(function (err) {
64-
throw err;
65-
});
56+
var chartConfigObject = {
57+
type: attrs.fcType,
58+
width: attrs.fcWidth,
59+
height: attrs.fcHeight,
60+
renderAt: element[0],
61+
dataFormat: 'json',
62+
events: events
63+
};
64+
chart = new FusionCharts(chartConfigObject);
65+
chart.setJSONUrl(attrs.fcJsonUrl);
66+
scope[attrs.fcChartObject] = chart;
67+
chart.render ();
6668
} else {
6769
var chartConfigObject = {
6870
type: attrs.fcType,

0 commit comments

Comments
 (0)