używam nvd3 narysować wykres liniowy i kiedy przekazać div nvd3
narysować wykres jej dać mi ten błądUncaught TypeError: nie można odczytać właściwość „createElementNS” o nieokreślonej
Uncaught TypeError: Cannot read property 'createElementNS' of undefined
Oto kod :
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);
moje pytania,
- gdzie robię źle
- jest coś mi brakuje
u można umieścić skrzypce –
'createElementNS' nie jest nawet wymienione w kodzie pisał, więc ten kod może; t wywołały go. Chyba że jest to coś ogólnego z biblioteki. – somethinghere