I'm trying to display two pie chart visualisations on a single page.
Unfortunately only one of them is rendered.
If I comment out one of them then the other one is rendered so each one is rendered fine but not both of them.
When both of them are being rendered then only first one is rendered but only the chart without the legend.
I can see that for loop in line 29 of modules/d3/js/d3.js stops iterating through visualisation ids after rendering first visualisation.
It looks like loop execution is interrupted because of this exception:
TypeError: d3.tileText is not a function
If I comment out a line of code in piechart.js where titleText is used as a function then other exceptions appear:
TypeError: d3.splitString is not a function
TypeError: labelWrapper.selectAll(...).enter is not a function
When I comment out code in piechart.js where these function are called then I'm getting two charts without their legends.
Comments
Comment #1
PawelR commentedComment #2
PawelR commentedComment #3
cptroot commentedIt seems that the page is missing the d3.extend library. d3.extend adds both d3.tileText, and d3.splitString, and should be attached to the page by the d3 module.
Because it didn't, I just want to double check a few things:
Hopefully it's either an old issue that can be fixed by updating, or it's a bug with d3_views that is already fixed on master.
Comment #4
alansaviolobo commentedI was facing a similar issue (only 1 chart showing per page)
I figured the issue was that both the views were not getting unique ids and hence were not getting rendered.
I fixed the issue by changing line 316 of d3_views_plugin_style_d3.inc to
Comment #5
asherry commentedThe line should currently be:
and that's line 298. http://cgit.drupalcode.org/d3/tree/modules/d3_views/views/plugins/d3_vie...
Are you both using the latest dev release?
Comment #6
alansaviolobo commentedmy bad, you are correct. The reason I reported line no 316 is due to the patch submitted here
and yes, I am on the latest dev.
Comment #7
asherry commentedSo the problem is then that $this->view->dom_id is showing up as null or false?
Comment #8
asherry commentedComment #9
guignonv