setting canvas element and Bullet charts

104 views
Skip to first unread message

Daniel Abel

unread,
May 28, 2011, 5:47:58 PM5/28/11
to protovis
Hi!

The recommended way to set the dom element where protovis' will svg
appear is to set the canvas property of the root panel, ie. do
var vis = new pv.Panel().canvas('id-of-element')

However, it appears that this won't work for bullet charts
(pv.Layout.Bullet): when I set the canvas element using the above, the
individual bullet charts get drawn on top of each other. As a
testcase, inserting the ".canvas('fig')" into the code at
http://vis.stanford.edu/protovis/ex/bullet-full.html triggers this
bug.

Is this a known bug? Is there some way to avoid / workaround it? I
need to set the canvas property because I want to load protovis'
javascript via ajax, after the page is loaded (I want to be able to
dynamically switch / update the visualization).

Thanks in advance,
Daniel Abel

Jason Mahoney

unread,
Mar 31, 2012, 5:01:23 AM3/31/12
to prot...@googlegroups.com
I have just started using Protovis and I have just encountered this issue with a dashboard that I am developing.  It has 4 charts and 2 are Bullet charts.

Can anyone advise whether a workaround or solution was identified for this issue.

Many thanks

Jason

Hrishikesh Ballal

unread,
May 25, 2012, 7:14:59 AM5/25/12
to prot...@googlegroups.com
+1 from my side. Encountering the same problem. Can someone help?

Hrishikesh Ballal

unread,
May 25, 2012, 9:41:36 AM5/25/12
to prot...@googlegroups.com
+1 for this. Can anyone help please? I hacked it so that i have different divs for each single bullet but there is some weird error in Chrome that i get if I do it this way. 


On Saturday, 31 March 2012 10:01:23 UTC+1, Jason Mahoney wrote:

Jason Mahoney

unread,
May 25, 2012, 3:21:56 PM5/25/12
to prot...@googlegroups.com
I ended up with a similar solution but used span rather than div.  Basically created an object div and then appended each span to it as it was created.  Works fine for me, however I havent tested it in Chrome as none of my users use that browser.
Reply all
Reply to author
Forward
0 new messages