[FIX] CHART: 'ischartempty' not defined error
This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
$(document).ready(function () {
|
||||
//Hired candididates recruitment wise chart
|
||||
function isChartEmpty(chartData) {
|
||||
if (!chartData) {
|
||||
return true;
|
||||
}
|
||||
for (let i = 0; i < chartData.length; i++) {
|
||||
|
||||
if (chartData[i]) {
|
||||
const hasNonZeroValues = chartData.some((value) => value !== 0);
|
||||
if (hasNonZeroValues) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/onboarding/hired-candidate-chart",
|
||||
|
||||
@@ -16,8 +16,9 @@ function isChartEmpty(chartData) {
|
||||
return true;
|
||||
}
|
||||
for (let i = 0; i < chartData.length; i++) {
|
||||
if (chartData[i] && chartData[i].data) {
|
||||
const hasNonZeroValues = chartData[i].data.some((value) => value !== 0);
|
||||
|
||||
if (chartData[i]) {
|
||||
const hasNonZeroValues = chartData.some((value) => value !== 0);
|
||||
if (hasNonZeroValues) {
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +74,7 @@ $.ajax({
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
success: (response) => {
|
||||
if (isChartEmpty(response.data)) {
|
||||
if (isChartEmpty(response.objective_value)) {
|
||||
$("#objectiveChart")
|
||||
.parent()
|
||||
.html(
|
||||
@@ -174,7 +175,7 @@ $.ajax({
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
success: (response) => {
|
||||
if (isChartEmpty(response.data)) {
|
||||
if (isChartEmpty(response.key_result_value)) {
|
||||
$("#keyResultChart")
|
||||
.parent()
|
||||
.html(
|
||||
@@ -274,7 +275,7 @@ $.ajax({
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
success: (response) => {
|
||||
if (isChartEmpty(response.data)) {
|
||||
if (isChartEmpty(response.feedback_value)) {
|
||||
$("#feedbackChart")
|
||||
.parent()
|
||||
.html(
|
||||
|
||||
Reference in New Issue
Block a user