Since I am trying to find a fast charting library to show charts on mobile devices, performance was important for me. It also had to have a licence that makes it possible to use commercially. I compared:
- c3, which is based on d3 and therefore uses SVG
- chart.js which is using canvas
The charts are loaded inside a WebView component inside a native app and all data (including the JS library) is local, so no slow down due to http requests. To maximize performance even more, I additionally put everything inside one single file.
I loaded 4 charts (line, bar, pie, line/bar combo) with together around 500 datapoints.
My time measuring exluded the actual loading of the html page. I measured form the moment I started using the charting library code until the end of rendering. All chart animation was turned off.
C3 took around 1500-1800 ms on modern Android and IPhone devices. iPhone performed around 100ms better than Android.
Chart.js took around 400-800ms. Android performed around 300ms better than iPhone.
No surprise, the SVG is slower. Depending on your use case, maybe too slow.
On a desktop computer rendering in c3 was around 150-200ms and charts.js around 80-100ms. Running the same test in Android and iPhone emulator had the same result as on desktop. So the slow down on mobile devices is definitely due to hardware/processing limits.
Hope that helps