Do not attempt to render budget graph when no data available
This commit is contained in:
parent
5994cd38b6
commit
7f6bf1b07f
@ -156,6 +156,7 @@ function makeGrid() {
|
|||||||
function makeCharts() {
|
function makeCharts() {
|
||||||
// Display expense, revenue charts on budget view page
|
// Display expense, revenue charts on budget view page
|
||||||
|
|
||||||
|
if (document.getElementById('chartExpenses')) {
|
||||||
new Chart(document.getElementById('chartExpenses'), {
|
new Chart(document.getElementById('chartExpenses'), {
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
data: {
|
data: {
|
||||||
@ -175,7 +176,9 @@ function makeCharts() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById('chartRevExp')) {
|
||||||
new Chart(document.getElementById('chartRevExp'), {
|
new Chart(document.getElementById('chartRevExp'), {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: {
|
data: {
|
||||||
@ -204,4 +207,5 @@ function makeCharts() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user