score:0
i'm not familiar with d3.js ,
before that, i have to know that, does your code working well for single svg? you got a error on multiple svg used right?
if it is, you will try the following code
function saveimage(){
var html = d3.selectall("svg")
.attr("version", 1.1)
.attr("xmlns", "http://www.w3.org/2000/svg")
.node().parentnode.innerhtml;
for(var i=0;i<html.length;i++)
{
var imgsrc = 'data:image/svg+xml;base64,'+ btoa(html[i]);
var img = '<img src="'+imgsrc+'"/>';
d3.select("#svgdataurl").html(img);
console.log(html[i]);
}
};
Source: stackoverflow.com
Related Query
- Converting more than one SVG element to PNG in Javascript
- Giving an element more than one event handler by selecting it using different selectors
- D3 transitions on more than 1 svg element
- Resizing more than one svg graph on the same web page
- Append SVG canvas to element other than body using D3
- how to assign unique id to SVG text element in d3 javascript
- Adding css style when converting svg to png
- Javascript D3.js drag a chart out of its svg Element
- D3js include more than one style
- SVG zoom issue in IE10 (expand more than SVG size)
- D3js: Hard embedding png into svg element via base64 data uri?
- Darken the color of svg element each time on button click using D3 V3 or JavaScript
- Exporting svg to png or other image with styling, using JavaScript
- D3. Can more then one element be associated with a single datum?
- I'm having trouble getting multiple isotype graphs on one page. I think the problem may be with the svg <use> element .selectAll("use")
- height,width and font not consistent when converting svg to png
- SVG to PNG Conversion in javascript
- associating a javascript object to an SVG element
- d3.json cant read from json file more than one object
- JavaScript library more efficient than Rickshaw for realtime visualizations
- How to add tooltip to an svg graphics element using javascript
- Saving a SVG element as PNG on local system
- Hide more than one json d3 group
- d3js V6, how to use more than one left axis?
- How to link from path elements in one svg to a different element of another svg
- d3.js choropleth map --How do I map more than one property from CSV to JSON, so I can use it in a tooltip?
- How to use more than one related dataset?
- How to create more than one d3 polygon
- Problem with label position with more than one nvd3 graph on one site
- svg coordinate of g element larger than other element
More Query from same tag
- Using CSS Scale/Matrix doesn't keep background aligned with elements
- d3.js - area chart vertical overflow if y.domain doesn't start at 0
- d3 checking for types and setting a type accordingly
- Set translated position as new x,y position
- Is it possible to start a D3JS pie chart with all values being 0?
- How can I add labels to my diagram with d3.js?
- Why does my JSON update for one API but not the other?
- How do you retrieve the key values of a nested data set in D3
- LINKS IN Collapsible Tree in D3.js
- Update the context line upon loading new data d3
- How to reload div using d3.js library
- d3 to create paths based on separate array of data
- getting rid of <canvas> to display polygons on top of image with .tif extension
- d3.js forcelayout not showing up with data from python on flask
- Dash around single point in interpolated curve with d3.js
- D3 creating X-axis
- How to change tick labels in d3.svg.axis()
- Positioning multiple SVG elements in div HTML
- How do I get rid of tiny lines between canvas rects
- Bubble highlight feature in d3js bubble chart
- Access subkeys in multi-dimensional JavaScript object
- D3 Animating a Graph onLoad of page
- Fetch JSON data using Authorization header in D3 v5
- D3 ticks() does not return value if provided scale has only 1 result
- d3: key function choice when appending element to an existing svg
- Using D3 slider to change attribute
- How to access a nested key in json using javascript
- DOM does not represent the html structure of d3 force layout
- D3js Grouped Scatter plot with no collision
- D3 line chart same tick on hover gives different values