summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pharos-dashboard/static/js')
-rw-r--r--tools/pharos-dashboard/static/js/flot-pie-chart.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/pharos-dashboard/static/js/flot-pie-chart.js b/tools/pharos-dashboard/static/js/flot-pie-chart.js
new file mode 100644
index 00000000..98d174e4
--- /dev/null
+++ b/tools/pharos-dashboard/static/js/flot-pie-chart.js
@@ -0,0 +1,22 @@
+function loadChartData(chart_id, url) {
+ $.ajax({
+ url: url,
+ type: 'get',
+ success: function (data) {
+ var data = data['data'];
+ $(function () {
+ var plotObj = $.plot($("#" + chart_id), data, {
+ series: {
+ pie: {
+ show: true
+ }
+ }
+ });
+ });
+ },
+ failure: function (data) {
+ alert('Error loading data');
+ }
+ });
+
+} \ No newline at end of file