سؤال

Look at this example https://developers.google.com/chart/interactive/docs/gallery/orgchart

I would like to know how can I add line breaks or html tags in the tooltips column. Something like this (not working):

['Alice', 'Mike', 'Text1 <br text2 '],

or

['Alice', 'Mike', 'Text1 <br> text2 '],

Column 2 - [optional] Tool-tip text to show, when a user hovers over this node.

Thanks.

هل كانت مفيدة؟

المحلول

Tooltip from:

    ['Bob', 'Jim', 'Bob Sponge'],

is coded as:

    <td colspan="6" class="google-visualization-orgchart-node google-visualization-orgchart-node-medium" 
        title="Bob Sponge">Bob</td>

so option allowHtml:true wouldn't help. Tooltip is just plain html title attribute. So you can use unicode for line feed:

    ['Bob', 'Jim', 'Bob\u000ASponge'],
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top