Disabling unwanted borders when exporting charts with wkhtmltopdf

wkhtmltopdf is a headless browser that allows turning web pages, including dynamic content such as charts, into PDF documents.

It works with amCharts pretty well, save for one minor annoyance - it produces a visible border around chart elements, like legend and plot area.

To work around it follow these simple steps:

1) Enable chart element class names by using addClassNames:

"addClassNames": true

2) Disable display of borders in @media print CSS:

@media print {
  .amcharts-bg, .amcharts-plot-area, .amcharts-legend-bg {
    display: none;

P.S. in order for this to work, you also need to use --print-media-type command line option in wkhtmltopdf.