How to use chartjs-chart-financial
See original GitHub issueDescribe the bug How to use an external chart, like chartjs-chart-financial? How to register the ‘plugin’ with Chartjs?
I tried this:
import { OhlcElement, OhlcController, CandlestickElement, CandlestickController } from 'chartjs-chart-financial'
import Chart from 'chart.js/auto' // Easy way of importing everything
Chart.register(OhlcElement, OhlcController, CandlestickElement, CandlestickController)
However, I get a TypeError: Cannot read property 'register' of undefined
.
How should I do this?
Versions
- NodeJS version: 14.18.1
- Chart.JS version: 3.6.0
- Typescript version: 4.4.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Chart.js - Financial chart
Chart.js - Financial chart. See the source for this example, README, and Chart.js docs for more details. Sample Chart. Bar Type: Candlestick, OHLC....
Read more >chartjs-chart-financial - npm
Chart.js module for charting financial securities. ... Start using chartjs-chart-financial in your project by running `npm i ...
Read more >Chart.js module for charting financial securities - GitHub
The plugins below may be particularly interesting to use with financial charts. See the Chart.js plugin API and longer list of plugins for...
Read more >chartjs-chart-financial examples - CodeSandbox
Learn how to use chartjs-chart-financial by viewing and forking example apps that make use of chartjs-chart-financial on CodeSandbox. ; Latest version0.1.1.
Read more >Financial | chartjs-plugin-streaming - nagix
For plain JavaScript, use script tags in the following order. <script src="path/to/chartjs/dist/chart.min.js"></script> <script ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I managed it to run properly with everything.
I will follow up shortly with a working example posting here. Thank you for looking into it.
Hi @dimisus,
Yeah, I had a propper look now and unfortunately getting the new(ish) adaptors working is not simple and definitely needs to be addressed in forthcoming versions of this lib. I managed to get it working with the below (at least I think so, based on the image 😃 ):
node version:
16.13.0
this lib version:4.1.6
deps: