Skip to content

Commit

Permalink
Merge pull request Sunbird-cQube#240 from pandutibil/development
Browse files Browse the repository at this point in the history
Legend removed from scatter plot in UDISE
  • Loading branch information
tibil-it authored Jul 24, 2022
2 parents a66b932 + 0b73dbc commit 62b3ca5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
52 changes: 27 additions & 25 deletions development/ui/back-end/controller/common/CommonController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1098,17 +1098,19 @@ function applyFilters(filters, rawData, groupByColumn, level = undefined) {
let filterProperty = filter.optionValueColumn ? filter.optionValueColumn : filter.column;

if (index === 0 || filters[index - 1].includeAll || filters[index - 1].defaultValue || (filters[index - 1].value && filters[index - 1].value !== '')) {
filter.options = [];
rawData.forEach(record => {
if (!filterOptionMap.has(record[filterProperty])) {
filter.options.push({
label: record[filter.column],
value: record[filterProperty]
});
if (filter.options.length === 0) {
filter.options = [];
rawData.forEach(record => {
if (!filterOptionMap.has(record[filterProperty])) {
filter.options.push({
label: record[filter.column],
value: record[filterProperty]
});

filterOptionMap.set(record[filterProperty], true);
}
});
filterOptionMap.set(record[filterProperty], true);
}
});
}

if (filter && filter.value === null) {
if (filter.options.length > 1) {
Expand All @@ -1127,25 +1129,25 @@ function applyFilters(filters, rawData, groupByColumn, level = undefined) {

filter.value = 'overall';
}
}
}

return filter;
});

filters.forEach((filter, index) => {
let filterProperty = filter.optionValueColumn ? filter.optionValueColumn : filter.column;
}

if (filter && filter.value !== null) {
let filterProperty = filter.optionValueColumn ? filter.optionValueColumn : filter.column;

if (filter.value && filter.value !== '' && filter.value !== 'overall') {
rawData = rawData.filter(record => {
return record[filterProperty] === filter.value;
});
if (filter.value && filter.value !== '' && filter.value !== 'overall') {
rawData = rawData.filter(record => {
return record[filterProperty] === filter.value;
});

if (filter.level) {
groupByColumn = filter.level.property;
level = filter.level.value;
if (filter.level) {
groupByColumn = filter.level.property;
level = filter.level.value;
}
}
}
}

return filter;
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export class SchoolFacilitiesComparisionComponent implements OnInit {
return (this.point as any).data;
}
},
legend: {
enabled: false
},
series: [{
name: 'PM Poshan Access',
type: 'scatter',
Expand Down

0 comments on commit 62b3ca5

Please sign in to comment.