mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-09 14:18:59 +00:00
New charts + tests.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
function drawChart(id,URL,opt) {
|
||||
function drawChart(id,URL,type,opt) {
|
||||
$.getJSON(URL).success(function (data) {
|
||||
$(id).removeClass('loading');
|
||||
|
||||
@@ -7,7 +7,17 @@ function drawChart(id,URL,opt) {
|
||||
var money = new google.visualization.NumberFormat({decimalSymbol: ',', groupingSymbol: '.', prefix: '€ '});
|
||||
money.format(gdata, 1);
|
||||
var gID = id.substring(1);
|
||||
var chart = new google.visualization.LineChart(document.getElementById(gID));
|
||||
var chart;
|
||||
switch(type) {
|
||||
default:
|
||||
case 'LineChart':
|
||||
chart = new google.visualization.LineChart(document.getElementById(gID));
|
||||
break;
|
||||
case 'PieChart':
|
||||
chart = new google.visualization.PieChart(document.getElementById(gID));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
chart.draw(gdata, opt);
|
||||
|
||||
|
Reference in New Issue
Block a user