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(
|
this.reportParamsSub = this.analyticsService.getReportParams(reportId).subscribe(
|
||||||
(res: ReportParametersModel) => {
|
(res: ReportParametersModel) => {
|
||||||
this.reportParameters = res;
|
this.reportParameters = res;
|
||||||
this.onSuccessReportParams.emit(res);
|
if (this.reportParameters.hasParameters()) {
|
||||||
|
this.onSuccessReportParams.emit(res);
|
||||||
|
} else {
|
||||||
|
this.onSuccess.emit();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(err: any) => {
|
(err: any) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -106,23 +106,25 @@ export class BarChart extends Chart {
|
|||||||
this.yAxisType = obj && obj.yAxisType || null;
|
this.yAxisType = obj && obj.yAxisType || null;
|
||||||
this.options.scales.xAxes[0].ticks.callback = this.xAxisTickFormatFunction(this.xAxisType);
|
this.options.scales.xAxes[0].ticks.callback = this.xAxisTickFormatFunction(this.xAxisType);
|
||||||
this.options.scales.yAxes[0].ticks.callback = this.yAxisTickFormatFunction(this.yAxisType);
|
this.options.scales.yAxes[0].ticks.callback = this.yAxisTickFormatFunction(this.yAxisType);
|
||||||
obj.values.forEach((params: any) => {
|
if (obj.values) {
|
||||||
let dataValue = [];
|
obj.values.forEach((params: any) => {
|
||||||
params.values.forEach((info: any) => {
|
let dataValue = [];
|
||||||
info.forEach((value: any, index: any) => {
|
params.values.forEach((info: any) => {
|
||||||
if (index % 2 === 0) {
|
info.forEach((value: any, index: any) => {
|
||||||
if (!this.labels.includes(value)) {
|
if (index % 2 === 0) {
|
||||||
this.labels.push(value);
|
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) {
|
xAxisTickFormatFunction = function (xAxisType) {
|
||||||
|
@ -38,7 +38,7 @@ export class ReportParametersModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hasParameters() {
|
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