javascript - Marimekko chart cell titles not updating -
i'm making visualization titanic data set https://www.kaggle.com/c/titanic/data, , after search found marimekko chart best visualization data set.
i looked @ http://www.jasondavies.com/mekko/ , began tweak code bit fit needs. problem cell titles (those appear after mouse - hover @ cell) not update values. first call function chart draws titles correctly, when try change cell values using transition function, charts animates values in cell titles not change, still have old values when hover @ them.
the last line in transition function is:
cellenter.append("title") .text(function(d) { return d.children ? null : title(d); });
which seems work first time chart drawn, doesn't update titles when cell data changes.
any ideas how fix ?
if you're curious see changes made, have @ working example http://codepen.io/hshihab/pen/pqwjmo
i made couple of small changes jason's original code show point.
as @lars kotthoff pointed out in comments, last line in transition function should changed to:
cellenter.append("title"); cellupdate.select("title") .text(function(d) { return d.children ? null : title(d); });
Comments
Post a Comment