mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
upgrade to latest ng2-charts (#1686)
This commit is contained in:
committed by
Mario Romano
parent
861393de60
commit
9c07262657
@@ -36,6 +36,7 @@ import { AppComponent } from './app.component';
|
|||||||
import { routing } from './app.routes';
|
import { routing } from './app.routes';
|
||||||
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
|
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
|
||||||
import { Editor3DModule } from 'ng2-3d-editor';
|
import { Editor3DModule } from 'ng2-3d-editor';
|
||||||
|
import { ChartsModule } from 'ng2-charts';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
HomeComponent,
|
HomeComponent,
|
||||||
@@ -73,7 +74,8 @@ import {
|
|||||||
UserInfoComponentModule.forRoot(),
|
UserInfoComponentModule.forRoot(),
|
||||||
AnalyticsModule.forRoot(),
|
AnalyticsModule.forRoot(),
|
||||||
CustomEditorsModule,
|
CustomEditorsModule,
|
||||||
Editor3DModule.forRoot()
|
Editor3DModule.forRoot(),
|
||||||
|
ChartsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
|
@@ -9,7 +9,7 @@ import '@angular/router';
|
|||||||
// RxJS
|
// RxJS
|
||||||
import 'rxjs';
|
import 'rxjs';
|
||||||
|
|
||||||
//Alfresco
|
// Alfresco
|
||||||
import 'ng2-alfresco-core';
|
import 'ng2-alfresco-core';
|
||||||
import 'ng2-alfresco-datatable';
|
import 'ng2-alfresco-datatable';
|
||||||
import 'ng2-activiti-diagrams';
|
import 'ng2-activiti-diagrams';
|
||||||
@@ -42,6 +42,7 @@ import '@angular/material/core/theming/prebuilt/deeppurple-amber.css'
|
|||||||
import 'ng2-activiti-form/stencils/runtime.ng1';
|
import 'ng2-activiti-form/stencils/runtime.ng1';
|
||||||
import 'ng2-activiti-form/stencils/runtime.adf';
|
import 'ng2-activiti-form/stencils/runtime.adf';
|
||||||
|
|
||||||
|
import 'ng2-charts';
|
||||||
import 'chart.js';
|
import 'chart.js';
|
||||||
require('script!raphael/raphael.min.js');
|
require('script!raphael/raphael.min.js');
|
||||||
|
|
||||||
|
@@ -74,9 +74,9 @@
|
|||||||
"pdfjs-dist": "1.5.404",
|
"pdfjs-dist": "1.5.404",
|
||||||
"flag-icon-css": "2.3.0",
|
"flag-icon-css": "2.3.0",
|
||||||
"moment": "2.15.1",
|
"moment": "2.15.1",
|
||||||
"chart.js": "2.3.0",
|
"chart.js": "2.5.0",
|
||||||
"ng2-charts": "1.1.0",
|
"ng2-charts": "1.5.0",
|
||||||
"raphael": "^2.2.6",
|
"raphael": "2.2.7",
|
||||||
"md-date-time-picker": "^2.2.0",
|
"md-date-time-picker": "^2.2.0",
|
||||||
"alfresco-js-api": "~1.2.0",
|
"alfresco-js-api": "~1.2.0",
|
||||||
"ng2-3d-editor": "0.0.15",
|
"ng2-3d-editor": "0.0.15",
|
||||||
|
@@ -183,7 +183,7 @@ gulp.task('build.bundles.app', (done) => {
|
|||||||
'ng2-alfresco-userinfo': 'node_modules/ng2-alfresco-userinfo/',
|
'ng2-alfresco-userinfo': 'node_modules/ng2-alfresco-userinfo/',
|
||||||
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/',
|
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/',
|
||||||
'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/',
|
'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/',
|
||||||
'ng2-charts': 'node_modules/ng2-charts',
|
'ng2-charts': 'node_modules/ng2-charts/bundles/ng2-charts.umd',
|
||||||
'moment': 'node_modules/moment/min/moment.min'
|
'moment': 'node_modules/moment/min/moment.min'
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@@ -25,7 +25,7 @@ import { AnalyticsComponent } from './src/components/analytics.component';
|
|||||||
import { AnalyticsGeneratorComponent } from './src/components/analytics-generator.component';
|
import { AnalyticsGeneratorComponent } from './src/components/analytics-generator.component';
|
||||||
import { AnalyticsReportHeatMapComponent } from './src/components/analytics-report-heat-map.component';
|
import { AnalyticsReportHeatMapComponent } from './src/components/analytics-report-heat-map.component';
|
||||||
import { AnalyticsService } from './src/services/analytics.service';
|
import { AnalyticsService } from './src/services/analytics.service';
|
||||||
import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts';
|
import { ChartsModule } from 'ng2-charts';
|
||||||
|
|
||||||
import { WIDGET_DIRECTIVES } from './src/components/widgets/index';
|
import { WIDGET_DIRECTIVES } from './src/components/widgets/index';
|
||||||
|
|
||||||
@@ -52,11 +52,11 @@ export const ANALYTICS_PROVIDERS: any[] = [
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CoreModule,
|
CoreModule,
|
||||||
|
ChartsModule,
|
||||||
DiagramsModule
|
DiagramsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
...ANALYTICS_DIRECTIVES,
|
...ANALYTICS_DIRECTIVES
|
||||||
...CHART_DIRECTIVES
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...ANALYTICS_PROVIDERS
|
...ANALYTICS_PROVIDERS
|
||||||
|
@@ -61,7 +61,7 @@ var map = {
|
|||||||
// other libraries
|
// other libraries
|
||||||
'rxjs': 'npm:rxjs',
|
'rxjs': 'npm:rxjs',
|
||||||
'ng2-translate': 'npm:ng2-translate',
|
'ng2-translate': 'npm:ng2-translate',
|
||||||
'ng2-charts' : 'npm:ng2-charts',
|
'ng2-charts': 'npm:ng2-charts/bundles/ng2-charts.umd.js',
|
||||||
'md-date-time-picker' : 'npm:md-date-time-picker',
|
'md-date-time-picker' : 'npm:md-date-time-picker',
|
||||||
'moment' : 'npm:moment/min/moment.min.js',
|
'moment' : 'npm:moment/min/moment.min.js',
|
||||||
|
|
||||||
@@ -74,7 +74,6 @@ var packages = {
|
|||||||
'app': { main: 'main.js', defaultExtension: 'js' },
|
'app': { main: 'main.js', defaultExtension: 'js' },
|
||||||
'rxjs': { defaultExtension: 'js' },
|
'rxjs': { defaultExtension: 'js' },
|
||||||
'ng2-translate': { defaultExtension: 'js' },
|
'ng2-translate': { defaultExtension: 'js' },
|
||||||
'ng2-charts': { defaultExtension: 'js' },
|
|
||||||
'md-date-time-picker': { defaultExtension: 'js' },
|
'md-date-time-picker': { defaultExtension: 'js' },
|
||||||
'moment': { defaultExtension: 'js' },
|
'moment': { defaultExtension: 'js' },
|
||||||
|
|
||||||
|
@@ -57,11 +57,11 @@
|
|||||||
"rxjs": "5.0.0-beta.12",
|
"rxjs": "5.0.0-beta.12",
|
||||||
"systemjs": "0.19.27",
|
"systemjs": "0.19.27",
|
||||||
"zone.js": "^0.6.23",
|
"zone.js": "^0.6.23",
|
||||||
"chart.js": "2.3.0",
|
"chart.js": "2.5.0",
|
||||||
"md-date-time-picker": "^2.2.0",
|
"md-date-time-picker": "^2.2.0",
|
||||||
"ng2-charts": "1.1.0",
|
"ng2-charts": "1.5.0",
|
||||||
"moment": "2.15.1",
|
"moment": "2.15.1",
|
||||||
"raphael": "^2.2.6",
|
"raphael": "2.2.7",
|
||||||
"alfresco-js-api": "~1.2.0",
|
"alfresco-js-api": "~1.2.0",
|
||||||
"ng2-translate": "2.5.0",
|
"ng2-translate": "2.5.0",
|
||||||
"ng2-alfresco-core": "1.2.0",
|
"ng2-alfresco-core": "1.2.0",
|
||||||
|
@@ -16,10 +16,11 @@
|
|||||||
<div *ngIf="!report.hasData()">{{'ANALYTICS.MESSAGES.NO-DATA-FOUND' | translate}}</div>
|
<div *ngIf="!report.hasData()">{{'ANALYTICS.MESSAGES.NO-DATA-FOUND' | translate}}</div>
|
||||||
<div *ngIf="report.hasData()">
|
<div *ngIf="report.hasData()">
|
||||||
<div *ngIf="report.hasZeroValues()">{{'ANALYTICS.MESSAGES.ZERO-DATA-FOUND' | translate}}</div>
|
<div *ngIf="report.hasZeroValues()">{{'ANALYTICS.MESSAGES.ZERO-DATA-FOUND' | translate}}</div>
|
||||||
<base-chart *ngIf="!report.hasZeroValues()" class="chart"
|
<canvas baseChart *ngIf="!report.hasZeroValues()" class="chart"
|
||||||
[data]="report.data"
|
[data]="report.data"
|
||||||
[labels]="report.labels"
|
[labels]="report.labels"
|
||||||
[chartType]="report.type"></base-chart>
|
[chartType]="report.type">
|
||||||
|
</canvas>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,11 +70,12 @@
|
|||||||
<div class="col-md-6" *ngIf="isCurrent(idx)">
|
<div class="col-md-6" *ngIf="isCurrent(idx)">
|
||||||
<h4>{{report.title}}</h4>
|
<h4>{{report.title}}</h4>
|
||||||
<div *ngIf="!report.hasDatasets()">{{'ANALYTICS.MESSAGES.NO-DATA-FOUND' | translate}}</div>
|
<div *ngIf="!report.hasDatasets()">{{'ANALYTICS.MESSAGES.NO-DATA-FOUND' | translate}}</div>
|
||||||
<base-chart *ngIf="report.hasDatasets()" class="chart"
|
<canvas baseChart *ngIf="report.hasDatasets()" class="chart"
|
||||||
[datasets]="report.datasets"
|
[datasets]="report.datasets"
|
||||||
[labels]="report.labels"
|
[labels]="report.labels"
|
||||||
[options]="report.options"
|
[options]="report.options"
|
||||||
[chartType]="report.type"></base-chart>
|
[chartType]="report.type">
|
||||||
|
</canvas>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngSwitchCase="'multiBar'">
|
<div *ngSwitchCase="'multiBar'">
|
||||||
@@ -88,11 +90,12 @@
|
|||||||
(change)="refresh(report)">
|
(change)="refresh(report)">
|
||||||
<span class="mdl-checkbox__label">Stacked</span>
|
<span class="mdl-checkbox__label">Stacked</span>
|
||||||
</label>
|
</label>
|
||||||
<base-chart class="chart"
|
<canvas baseChart class="chart"
|
||||||
[datasets]="report.datasets"
|
[datasets]="report.datasets"
|
||||||
[labels]="report.labels"
|
[labels]="report.labels"
|
||||||
[options]="report.options"
|
[options]="report.options"
|
||||||
[chartType]="'bar'"></base-chart>
|
[chartType]="'bar'">
|
||||||
|
</canvas>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||||
import { DebugElement } from '@angular/core';
|
import { DebugElement } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Rx';
|
||||||
import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts';
|
import { ChartsModule } from 'ng2-charts';
|
||||||
import { CoreModule, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
import { CoreModule, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||||
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
||||||
|
|
||||||
@@ -59,11 +59,11 @@ describe('AnalyticsGeneratorComponent', () => {
|
|||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
|
ChartsModule,
|
||||||
DiagramsModule.forRoot()
|
DiagramsModule.forRoot()
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
...ANALYTICS_DIRECTIVES,
|
...ANALYTICS_DIRECTIVES
|
||||||
...CHART_DIRECTIVES
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...ANALYTICS_PROVIDERS
|
...ANALYTICS_PROVIDERS
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||||
import { DebugElement } from '@angular/core';
|
import { DebugElement } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Rx';
|
||||||
import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts';
|
import { ChartsModule } from 'ng2-charts';
|
||||||
import { CoreModule, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
import { CoreModule, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||||
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
||||||
|
|
||||||
@@ -58,11 +58,11 @@ describe('AnalyticsComponent', () => {
|
|||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
|
ChartsModule,
|
||||||
DiagramsModule.forRoot()
|
DiagramsModule.forRoot()
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
...ANALYTICS_DIRECTIVES,
|
...ANALYTICS_DIRECTIVES
|
||||||
...CHART_DIRECTIVES
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...ANALYTICS_PROVIDERS
|
...ANALYTICS_PROVIDERS
|
||||||
|
Reference in New Issue
Block a user