Sto usando nvd3 per disegnare un grafico a linee e quando passo il div per nvd3
per disegnare un grafico la sua darmi questo erroreUncaught TypeError: Impossibile leggere la proprietà 'createElementNS' di indefinito
Uncaught TypeError: Cannot read property 'createElementNS' of undefined
Ecco il codice :
var chartDiv = 'line-chart'+ counter++;
tmpl = $($('#charts-panel-template').clone().html());
tmpl.find('.feature-line-chart').attr('id', chartDiv);
var div=tmpl.find('.feature-line-chart#'+chartDiv);
chartsPanel.append(tmpl);
nv.addGraph(function() {
var chart;
var width = 1024, height = 500;
chart = nv.models.lineChart()
// .color(sparkChart.colors)
.width(width).height(height);
//modify the x.axes
chart.x(function(d,i) {
return d.x;
});
//giving chart margin
chart.margin({right: 40});
$(div).empty();
//create chart
var svg = d3.select(div).append('svg')
.datum(data)
.transition()
.duration(500)
.call(chart)
.attr('width', width)
.attr('height', height);
mie domande,
- dove sto facendo male
- è qualcosa che mi manca
u può inviare un violino –
'createElementNS' non è nemmeno menzionato nel codice che hai postato, quindi questo codice può; t hanno innescato. A meno che non sia qualcosa di generale dalla biblioteca. – somethinghere