Skip to content

Commit fc64e67

Browse files
committed
Add support to change Type of chart
Add support to change Type of chart
1 parent bd3e613 commit fc64e67

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/angular-fusioncharts.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@
112112
}
113113
}, true);
114114
} else {
115+
attrs.$observe('type', function (newVal) {
116+
setTimeout(function () {
117+
chartConfigObject.type = newVal;
118+
if (chart)
119+
{
120+
chart.dispose();
121+
chart = new FusionCharts(chartConfigObject);
122+
scope[attrs.chartobject] = chart;
123+
chart.render();
124+
}
125+
}, 0);
126+
}, true)
115127
attrs.$observe('chart', function (newVal) {
116128
setTimeout(function () {
117129
chartConfigObject.dataSource.chart = JSON.parse(newVal);
@@ -280,4 +292,4 @@
280292
}
281293
}
282294
]);
283-
}());
295+
}());

0 commit comments

Comments
 (0)