Open Antoine38660 opened 6 years ago
Hi, you can get the component instance using the drawCallback:(dygraph: Dygraph, is_initial: boolean). Just 've to define your callback lambda on the options.
Well, to enforce my previous answer, i would suggest to add (dygraphs + @types/dygraphs) npm packages to your project to make your mind up and to get all available dygraph options. Then to type your callback dygraph instance as Dygraph, just do an import as below . import Dygraph from 'dygraphs'; Hope this helps :smile:
It seems impossible to access the chart methods such as
.resetZoom()
and.xAxisRange()
as described here: http://dygraphs.com/jsdoc/symbols/Dygraph.html Because_g
(the chart instance) is private so we can't access it. AlsoNgDygraphsComponent
isn't exported in index.ts (but available by importingɵa
from 'ng-dygraphs').Is there a good reason to keep
_g
andNgDygraphsComponent
private?FYI: angular2-chartjs use this way to allow developers to access to the chart instance (https://github.com/emn178/angular2-chartjs/issues/2#issuecomment-255632335)