chartjs / chartjs/chartjs-chart-financial

Problem with libary and nodejs, browserless usage

Open
#116 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
809
Forks
199
PR merge metrics
No merged PRs in 30d

Description

Hi, i try to use your library without browser (pure nodejs/typescript).
There ist a problem in usage discussed here:

https://github.com/SeanSobey/ChartjsNodeCanvas/issues/47

I got this error:

return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);
^

TypeError: Cannot read property 'prototype' of undefined
at TypedRegistry.isForType (E:\_dev\vhs\git\mmproject\node_modules\chart.js\dist\chart.js:5980:74)
at Registry._getRegistryForType (E:\_dev\vhs\git\mmproject\node_modules\chart.js\dist\chart.js:6123:15)
at E:\_dev\vhs\git\mmproject\node_modules\chart.js\dist\chart.js:6103:41
at Array.forEach ()
at Registry._each (E:\_dev\vhs\git\mmproject\node_modules\chart.js\dist\chart.js:6102:15)
at Registry.add (E:\_dev\vhs\git\mmproject\node_modules\chart.js\dist\chart.js:6060:10)
at Function.value [as register] (E:\_dev\vhs\git\mmproject\node_modules\chart.js\dist\chart.js:7357:16)
at Object. (E:\_dev\vhs\git\mmproject\lib\index.js:22:16)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

my node dependencys:

"dependencies": {
"chartjs-chart-financial": "0.1.1",
"@babel/core": "7.16.0",
"@babel/preset-env": "7.16.4",
"@babel/preset-typescript": "7.16.0",
"@types/chart.js": "2.9.34",
"@types/jest": "27.0.3",
"@types/jsdom": "16.2.13",
"babel-jest": "27.4.4",
"canvas": "2.8.0",
"chart.js": "3.6.2",
"dotenv": "10.0.0",
"ftx-api": "1.0.19",
"jest": "27.4.3",
"jsdom": "19.0.0",
"npm-check-updates": "12.0.3",
"prettier": "2.5.1",
"trading-signals": "3.2.0",
"ts-jest": "27.1.0",
"ts-loader": "9.2.6",
"typescript": "4.5.4"
}

try to register candlestick Controller

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)

please help me :-)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.