Có ai đã thử sử dụng thư viện svg to canvas khi tạo trực quan d3.js không? Tôi đã cố gắng sử dụng canvg.js và d3.js để chuyển đổi svg để vải từ bên trong một webview 2.3 ứng dụng android, nhưng khi tôi gọi:SVG vào Canvas với d3.js
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;");
tôi nhận được lỗi: Loại lỗi chưa gặp: Không thể gọi phương thức ' setProperty 'of null http://mbostock.github.com/d3/d3.js?2.5.0:1707
Ứng dụng trình duyệt không đầu nào hoặc trình phân tích cú pháp phía máy chủ có hoạt động không? Có ai gặp phải điều này trước đây không?
Đây là một câu hỏi lớn như vậy, tôi muốn ai đó sẽ trả lời nó. – Apollo