How to add a Protovis diagram to a specific HTML tag?

I have a div tag with the identifier "chart", but how do I get Protovis to display a chart inside this tag?

I tried the canvas method, but it did not work.

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

I need my JS code to lubricate the diagram as part of the structure I'm working on, and cannot have scripts inside the HTML body.

+3
source share
1 answer

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 the root pane panel .

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

+5
source

Source: https://habr.com/ru/post/1787359/


All Articles