mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
commit
1c80f89e93
@ -134,7 +134,11 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges {
|
||||
this.reportParamsSub = this.analyticsService.getReportParams(reportId).subscribe(
|
||||
(res: ReportParametersModel) => {
|
||||
this.reportParameters = res;
|
||||
this.onSuccessReportParams.emit(res);
|
||||
if (this.reportParameters.hasParameters()) {
|
||||
this.onSuccessReportParams.emit(res);
|
||||
} else {
|
||||
this.onSuccess.emit();
|
||||
}
|
||||
},
|
||||
(err: any) => {
|
||||
console.log(err);
|
||||
|
@ -106,23 +106,25 @@ export class BarChart extends Chart {
|
||||
this.yAxisType = obj && obj.yAxisType || null;
|
||||
this.options.scales.xAxes[0].ticks.callback = this.xAxisTickFormatFunction(this.xAxisType);
|
||||
this.options.scales.yAxes[0].ticks.callback = this.yAxisTickFormatFunction(this.yAxisType);
|
||||
obj.values.forEach((params: any) => {
|
||||
let dataValue = [];
|
||||
params.values.forEach((info: any) => {
|
||||
info.forEach((value: any, index: any) => {
|
||||
if (index % 2 === 0) {
|
||||
if (!this.labels.includes(value)) {
|
||||
this.labels.push(value);
|
||||
if (obj.values) {
|
||||
obj.values.forEach((params: any) => {
|
||||
let dataValue = [];
|
||||
params.values.forEach((info: any) => {
|
||||
info.forEach((value: any, index: any) => {
|
||||
if (index % 2 === 0) {
|
||||
if (!this.labels.includes(value)) {
|
||||
this.labels.push(value);
|
||||
}
|
||||
} else {
|
||||
dataValue.push(value);
|
||||
}
|
||||
} else {
|
||||
dataValue.push(value);
|
||||
}
|
||||
});
|
||||
});
|
||||
if (dataValue && dataValue.length > 0) {
|
||||
this.datasets.push({data: dataValue, label: params.key});
|
||||
}
|
||||
});
|
||||
if (dataValue && dataValue.length > 0) {
|
||||
this.datasets.push({data: dataValue, label: params.key});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
xAxisTickFormatFunction = function (xAxisType) {
|
||||
|
@ -38,7 +38,7 @@ export class ReportParametersModel {
|
||||
}
|
||||
|
||||
hasParameters() {
|
||||
return (this.definition && this.definition.parameters) ? true : false;
|
||||
return (this.definition && this.definition.parameters && this.definition.parameters.length > 0) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user