Ionic 2 Charts: what's the best librarie

I want to make charts in ionic 2 graph .
I found some suggestion like chart.js and ng2-charts. What’s the difference between the two? and is there other libraries?

Try highcharts

ng2-charts is an angular wrapper for chart.js.
We tried ng2-charts to display charts, but it was too limiting, so we used chart.js directly.
Unfortunately the API and the documentation of chart.js is not very intuitive.
The results were satisfactory.

@juergenS So do you recommend to use chart.js ?
Thanks for your answer

puh. i don’t know your requirements.
i think it looks good, you can create complex graphs. so, if you find your desired graph in the examples, then use it

@juergenS I just want to do some line charts with the possibility of Zoom.

What do you mean with zoom.
If a user hides a line of your chart, chart.js readjusts the scale of the axes.
I don’t know, if you can zoom in, like on a map, which doesn’t means that it’s impossible.

Well zoom in & out like on a map

Having used Plotly.js in non-Angular applications, I’d normally highly recommend that. But as far as I understand, the current version 1.x of Plotly has some dependencies that doesn’t play nice with Angular (they plan to move away from those dependencies in version 2).

So I’ll second juergenS in pointing towards chart.js, even though I also found the documentation less than great (everything’s there, it just not very user friendly). I, however, found ng2-charts satisfactory for my needs, so I would begin with ng2-charts and then see if it is ‘enough’ for you.

As for gesture based zoom, there’s this plugin for chart.js:

But I have no idea of how well that would work with Ionic

1 Like

Tahnk you for your contribution @abildtofy . As you’ve said, the documentation isn’t great, I didn’t even find how to import the the zoom plugin in the page. The samples aren’t meant for an angular 2/Ionic 2 project.

Never mind the answers above are wrong. ChartJs really (sucks),Doc isn’t user-friendly. I recommend using D3.