I’m working on a project where I need to generate PDF reports that include chart visualizations. Currently we’re using PhantomJS as a headless browser to capture chart images and then embed them into our PDF documents. However this method is quite slow and affects our application performance.
I’m looking for alternative approaches to create charts directly on the server side without relying on headless browser technology. Our application runs on .NET framework using C# for the backend operations.
Has anyone found efficient ways to generate chart images programmatically? Any suggestions for libraries or techniques that could help improve the processing speed would be greatly appreciated.
Same issue here with PhantomJS in our reporting system. Switched to OxyPlot and it fixed everything. It’s a .NET charting library that creates images directly - no browser needed. Massive speed boost: went from 3-4 seconds per chart to under 500ms. Handles most chart types and exports to PNG or SVG. Easy install through NuGet, and the API’s pretty intuitive. We’ve been running it in production for over a year without problems.
We hit the same bottlenecks with headless browsers in our reporting pipeline. Ended up switching to System.Drawing.Common with Chart.js data structures that we parse server-side. Basically, you recreate the chart logic in C# instead of rendering actual Chart.js components. Performance boost was huge - no DOM manipulation or JS execution overhead. Fair warning though: you’ll handle all the chart styling and calculations yourself, which gets messy for complex visualizations. For basic stuff like bar graphs and line charts, it’s totally worth it. Development time’s reasonable and the speed gains are massive. Definitely consider it if you’re comfortable with GDI+ operations.
skiaSharp is great for this! it’s a cross-platform library from microsoft that does server-side chart generation pretty well. I’ve used it with .NET Core and honestly, the performance is way better than PhantomJS - no browser lag.