Open vzhilov opened 3 years ago
This project requires Chart.js 3.0. I wonder if you're using Chart.js 2.x?
Chart.js 3.0 is just only a beta issued just 3 days ago. You mean the upgrade will fix it?
I see, thank you very much.
v3.0.0-beta.4 Breaking Changes
7886 Shorten alignment settings for axes
7871 Polar Area elements.arc.angle option now returns degrees
#7843 Provide method to lookup a chart from a canvas
7833 Enable per-dataset circumference and rotation for pie/doughnut charts
After upgrading to chart.js@3.0.0-beta.5
git clone https://github.com/chartjs/chartjs-chart-financial
cd chartjs-chart-financial
npm install
gulp build
take built file from /dist, copy to my project and then:
const chartJsFactory = () => {
require('./dist/chartjs-chart-financial.js');
delete require.cache[require.resolve('chart.js')];
delete require.cache[require.resolve('./dist/chartjs-chart-financial.js')];
return Chart;
}
const canvasRenderService = new CanvasRenderService(width, height, undefined, undefined, chartJsFactory);
(node:6428) UnhandledPromiseRejectionWarning: ReferenceError: window is not defined at afterBuildTicks (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\dist\chartjs-chart-financial.js:154:22) at callback (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:305:15) at CategoryScale.afterBuildTicks (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:5112:5) at CategoryScale.update (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:5035:8) at fitBoxes (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:1538:9) at Object.update (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:1654:9) at Chart._updateLayout (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:6733:13) at Chart.update (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:6715:8) at new Chart (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chart.js\dist\chart.js:6477:10) at CanvasRenderService.renderChart (C:\inetpub\wwwroot\streamtrades.ru\telegram-stream-trades\node_modules\chartjs-node-canvas\dist\index.js:151:16)
Same problem here:
(node:6428) UnhandledPromiseRejectionWarning: ReferenceError: window is not defined
I guess no solution is available?
Hello, thank you for the great plugin!
I do:
As result I get a file in /dist directory and copy it to me NodeJS project folder.
In my NodeJS app I do:
When I run the app I get:
I have checked content of Chart.defaults and found that .elements is in ‘global’ so I changed
And eventually Error
on line 446
So I changed them to:
Then I got
So I chagned:
That handled all the errors. But still no candles drawn.
So probably the way I initially started is incorrect