codenautas / graphicator

Library for draw c3js charts using tabulator data
MIT License
0 stars 0 forks source link

descarga de gráficos (ver branch downloadchart) #20

Open euginio opened 5 years ago

euginio commented 5 years ago

Se puede hacer, pasando de SVG a canvas y de canvas a png o pdf, el único problema es repicar las reglas CSS que aplican a los elementos SVG (que están definidas en las hojas de estilos de C3) a reglas inline (attr style de cada subElemento) dentro del SVG.

euginio commented 5 years ago

some links from research https://github.com/exupero/saveSvgAsPng https://github.com/canvg/canvg https://jsfiddle.net/rq4f75ds/ http://bl.ocks.org/Rokotyan/0556f8facbaf344507cdc45dc3622177 https://stackoverflow.com/questions/37701361/exporting-c3-js-line-charts-to-png-images-does-not-work/37873386 https://stackoverflow.com/questions/11567668/svg-to-canvas-with-d3-js/23667012#23667012 http://svgopen.org/2010/papers/62-From_SVG_to_Canvas_and_Back/ https://stackoverflow.com/questions/3975499/convert-svg-to-image-jpeg-png-etc-in-the-browser#comment28332332_3976034 https://stackoverflow.com/questions/16049538/how-to-convert-save-d3-js-graph-to-pdf-jpeg