Generate PDF Charts with ChartJS in Rails 6

It gets messier when you try to render charts and graphs on PDF, as even widely used gem like wickedPDF doesn’t properly support HTML canvas element without applying patches, and becomes headache to upgrade in long run. Today I’ll tell you a quick way to build rich PDF charts in Rails using Google’s headless engine Puppeteer and chartJS library (or highcharts etc). There is a ruby wrapper of it with the name of Dhalang. Which is quite easy to setup.
Generate PDF Charts with ChartJS in Rails 6 #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/generate-pdf-charts-with-chartjs-in-rails-6

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles