From 703418c48a70f9e70be0c5c1a0eb3d0ca6112974 Mon Sep 17 00:00:00 2001 From: Aviad Pineles Date: Wed, 27 Mar 2019 18:26:46 +0200 Subject: [PATCH] demo: Demo custom chart type (financial) Closes #876 --- .gitmodules | 3 + chartjs-chart-financial | 1 + package-lock.json | 10 +++ package.json | 4 + projects/ng2-charts/package-lock.json | 2 +- projects/ng2-charts/package.json | 2 +- src/app/app.component.html | 2 +- src/app/app.component.spec.ts | 2 + src/app/app.module.ts | 2 + src/app/chart-host/chart-host.component.ts | 5 ++ .../financial-chart.component.css | 5 ++ .../financial-chart.component.html | 35 +++++++++ .../financial-chart.component.spec.ts | 29 +++++++ .../financial-chart.component.ts | 78 +++++++++++++++++++ 14 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 chartjs-chart-financial create mode 100644 src/app/financial-chart/financial-chart.component.css create mode 100644 src/app/financial-chart/financial-chart.component.html create mode 100644 src/app/financial-chart/financial-chart.component.spec.ts create mode 100644 src/app/financial-chart/financial-chart.component.ts diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..8ebcc7cb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "chartjs-chart-financial"] + path = chartjs-chart-financial + url = git@github.com:chartjs/chartjs-chart-financial.git diff --git a/chartjs-chart-financial b/chartjs-chart-financial new file mode 160000 index 00000000..de5d0d7b --- /dev/null +++ b/chartjs-chart-financial @@ -0,0 +1 @@ +Subproject commit de5d0d7bf6c8e3036938d0a7dd954eb55d3d43fc diff --git a/package-lock.json b/package-lock.json index 171144a6..c3583d6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2669,6 +2669,11 @@ "moment": "^2.10.2" } }, + "chartjs-adapter-luxon": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/chartjs-adapter-luxon/-/chartjs-adapter-luxon-0.1.1.tgz", + "integrity": "sha512-87RVm/8wRJ3aqWTVSwKjkF1Ec58pLJhmsU/WAHqxrJJvxEDHbU2Lv7U7TmJVtZ+pUVyct1EskayK3ZfUDoJ7PA==" + }, "chartjs-color": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.3.0.tgz", @@ -7433,6 +7438,11 @@ "yallist": "^2.1.2" } }, + "luxon": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.12.0.tgz", + "integrity": "sha512-enPnPIHd5ZnZT0vpj9Xv8aq4j0yueAkhnh4xUKUHpqlgSm1r/8s6xTMjfyp2ugOWP7zivqJqgVTkW+rpHed61w==" + }, "magic-string": { "version": "0.25.2", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz", diff --git a/package.json b/package.json index b0c31857..be732414 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "build:lib": "ng build ng2-charts", "build:schem": "cd ng2-charts-schematics && npm run build && cd ..", "build:changelog": "github_changelog_generator -u valor-software -p ng2-charts", + "install:financial": "git submodule update chartjs-chart-financial && cd chartjs-chart-financial && npm i && cd ..", + "build:financial": "cd chartjs-chart-financial && gulp build && xcopy /s /y dist ..\\dist\\chartjs-chart-financial\\ && cd ..", "publish:lib": "cd dist\\ng2-charts && npm publish && cd ..\\..", "publish:schem": "cd ng2-charts-schematics && npm publish && cd ..", "test": "ng test", @@ -31,10 +33,12 @@ "@angular/platform-browser-dynamic": "~7.2.11", "@angular/router": "~7.2.11", "chart.js": "^2.8.0", + "chartjs-adapter-luxon": "^0.1.1", "chartjs-plugin-annotation": "^0.5.7", "chartjs-plugin-datalabels": "^0.6.0", "core-js": "^2.5.4", "highlight.js": "^9.15.6", + "luxon": "^1.12.0", "marked": "^0.6.1", "ngx-highlightjs": "^3.0.3", "ngx-markdown": "^7.1.4", diff --git a/projects/ng2-charts/package-lock.json b/projects/ng2-charts/package-lock.json index e0e32474..dd53b8ba 100644 --- a/projects/ng2-charts/package-lock.json +++ b/projects/ng2-charts/package-lock.json @@ -1,6 +1,6 @@ { "name": "ng2-charts", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/projects/ng2-charts/package.json b/projects/ng2-charts/package.json index 32bc92b5..5c61d3ce 100644 --- a/projects/ng2-charts/package.json +++ b/projects/ng2-charts/package.json @@ -1,6 +1,6 @@ { "name": "ng2-charts", - "version": "2.1.0", + "version": "2.2.0", "peerDependencies": { "@angular/common": "^7.2.0", "@angular/core": "^7.2.0", diff --git a/src/app/app.component.html b/src/app/app.component.html index 8b5dc0a5..4dbba4fb 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -166,7 +166,7 @@

API

- +