chartjs / chartjs-plugin-zoom

Zoom and pan plugin for Chart.js
MIT License
593 stars 325 forks source link

helpers.merge is not a function in angular #264

Closed serbasii closed 5 years ago

serbasii commented 5 years ago

i get an error like this,

TypeError: helpers.merge is not a function at resolveOptions (chartjs-plugin-zoom.js:53) at Object.beforeInit (chartjs-plugin-zoom.js:430) at Object.notify (core.plugin.js:108) at Chart.Controller.initialize (core.controller.js:115) at new Chart.Controller (core.controller.js:104) at new Chart (core.js:7) at ChartComponent.webpackJsonp.../../../../angular2-chartjs/dist/chart.component.js.ChartComponent.create (chart.component.js:36) at ChartComponent.webpackJsonp.../../../../angular2-chartjs/dist/chart.component.js.ChartComponent.ngOnInit (chart.component.js:18) at checkAndUpdateDirectiveInline (core.es5.js:10843) at checkAndUpdateNodeInline (core.es5.js:12341)

Angular CLI: 1.6.1 Node: 8.9.4 OS: win32 x64

npm installed:

chart.js@2.5.0 chartjs-plugin-zoom@0.7.3

import 'hammerjs'
import 'chartjs-plugin-zoom'

@Component({
  selector: 'ngx-chartjs-event',
  template: `
    <chart type="line" [data]="data" [options]="options"></chart>
  `,
})
serbasii commented 5 years ago

Upgrade chart.js to 2.8.0

it works with error ;

TypeError: Cannot read property 'minor' of undefined at ChartElement.mergeTicksOptions (Chart.js:10257) at Chart.js:8630 at Object.each (Chart.js:1801) at Chart.buildOrUpdateScales (Chart.js:8599) at Chart.initialize (Chart.js:8487) at Chart.construct (Chart.js:8463)

benmccann commented 5 years ago

Sorry, but I haven't used Angular, so can't support it. Perhaps try posting on StackOverflow

arniepeloton commented 3 years ago

image Hello! I'm stuck here! Where can I find this 'merge' thing?

Chart.js version is 3.4.1 Datalabels version is 2.0.0