Ich versuche folgenden Code zu reagieren Diagramm mit D3-4.2.2.D3 Angular-cli: d3.getElementsByTagName ist keine Funktion
import * as D3 from 'd3';
let d3:any = D3;
var container = d3.getElementsByTagName('line-graph'),
width = container[0].offsetWidth,
height = container[0].offsetHeight;
var svg = d3.select(this.htmlElement).append("svg")
.attr("class", "line-graph")
.attr("width", "100%")
.attr("height", "100%")
.attr('viewBox', '0 0 ' + Math.min(width, height) + ' ' + Math.min(width, height))
.attr('preserveAspectRatio', 'xMinYMin')
.append("g")
.attr("transform", "translate(" + Math.min(width, height)/2 + "," + Math.min(width, height)/2 + ")");
Browser-Konsole gibt
d3.getElementsByTagName is not a function
Jeder Vorschlag geschätzt werden.
Danke
Ich bin mir nicht sicher, ob dies das gleiche Problem ist, aber sie ist eine Verknüpfung einer Stapelantwort, die http://stackoverflow.com/questions/26848368/typeerror-getelementsbytagname-is-not-a-function-issue helfen kann – Simo