d3.js ビジュアライゼーションを作成するときに、svg to canvas ライブラリを使用しようとした人はいますか? canvg.js と d3.js を使用して、Android 2.3 アプリケーションの webview 内から svg をキャンバスに変換しようとしましたが、呼び出すと:
svg.selectAll(".axis")
.data(d3.range(angle.domain()[1]))
.enter().append("g")
.attr("class", "axis")
.attr("transform", function(d) { return "rotate(" + angle(d) * 180 / Math.PI + ")"; })
.call(d3.svg.axis()
.scale(radius.copy().range([-5, -outerRadius]))
.ticks(5)
.orient("left"))
.append("text")
.attr("y",
function (d) {
if (window.innerWidth < 455){
console.log("innerWidth less than 455: ",window.innerWidth);
return -(window.innerHeight * .33);
}
else {
console.log("innerWidth greater than 455: ",window.innerWidth);
return -(window.innerHeight * .33);
}
})
.attr("dy", ".71em")
.attr("text-anchor", "middle")
.text(function(d, i) { return capitalMeta[i]; })
.attr("style","font-size:12px;");
エラーが表示されます: Uncaught TypeError: Cannot call method setProperty
of null http://mbostock.github.com/d3/d3.js?2.5.0:1707
ある種のヘッドレス ブラウザ アプリケーション、またはサーバー側の js パーサーは機能しますか? 誰もこれに遭遇したことがありますか?