Created
March 23, 2014 13:15
-
-
Save dogrunjp/9722936 to your computer and use it in GitHub Desktop.
D3.jsのテキストで特定の文字数以上の文字は途中から'…'などに文字を置き換える場合
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chart1.append("text") | |
.text(function(d){if(d.Title.length <= 23){return d.Title;} else if (d.Title.length > 23){txt = d.Title.substr(0,21)+'…';return txt;}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment