chartjs / chartjs-chart-financial

Chart.js module for charting financial securities
MIT License
725 stars 197 forks source link

How do you implement this library after Chart.js in Angular 2+? #43

Closed Xarialon closed 5 years ago

Xarialon commented 5 years ago

I need a way to implement this extra lib plugin. This is what I get to see after I add the chart.financial.js file in the index of Angular 6:

Uncaught TypeError: Cannot read property 'helpers' of undefined
    at module.exports (chart.financial.js:438)
    at Object.8../controller.candlestick.js (chart.financial.js:423)
    at o (chart.financial.js:9)
    at r (chart.financial.js:9)
    at chart.financial.js:9
Xarialon commented 5 years ago

@benmccann

I have managed to achieve this by doing your way, but I still get errors like this one:

AppComponent_Host.ngfactory.js? [sm]:1 ERROR Error: "candlestick" is not a chart type.
    at Chart.<anonymous> (core.controller.js:336)
    at Object.each (helpers.core.js:108)
    at Chart.buildOrUpdateControllers (core.controller.js:318)
    at Chart.update (core.controller.js:391)
    at Chart.construct (core.controller.js:128)
    at new Chart (core.js:42)
    at AppComponent.push../src/app/app.component.ts.AppComponent.ngOnInit (app.component.ts:78)
    at checkAndUpdateDirectiveInline (core.js:9250)
    at checkAndUpdateNodeInline (core.js:10514)
    at checkAndUpdateNode (core.js:10476)
benmccann commented 5 years ago

Sorry, but I'm not familiar with Angular 2, so I'm not sure there's much I can do to help