문제

I have a div tag with id "chart" but how do I get Protovis to render the chart inside that tag?

I tried the canvas method but it did not work.

var vis = new pv.Panel().canvas("chart").width(width).height(height)

I need to keep my JS code the greates the chart as part of the framework I'm working on and can't have scripttags inside the HTML body.

도움이 되었습니까?

해결책

This definitely works for me in the latest version of Protovis (3.2):

<div id="#chart-div"></div>

var vis = new pv.Panel().canvas('chart-div')

Make sure its the root panel though.

http://groups.google.com/group/protovis/browse_thread/thread/1ff9530cee6133ff

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top