3

I am planning to export c3 charts using https://github.com/Xportability/css-to-pdf. But CSS2PDF requires the SVG tags to contain attributes xmlns="http://www.w3.org/2000/svg" and xmlns:xlink="http://www.w3.org/1999/xlink" to be a valid for export.

How to add these two attributes to svg element generated by c3 chart ?

Kevin Brown
  • 8,805
  • 2
  • 20
  • 38
yogi
  • 91
  • 2
  • 11

1 Answers1

1
$(document).ready(function () {
        var svg = $('#chart').find('svg')[0];
    svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
    svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');

     });    
yogi
  • 91
  • 2
  • 11