How do I append Protovis chart to a specific HTML tag?

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.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.