Putting tool tip in multiple lines |
FusionCharts v3 allows you to put your tool tips in multiple lines with a little manual tweaking. Consider the XML below: |
| <chart> <set label='John' value='420' tooltext='John Miller<BR>Score: 420<BR>Rank:2'/> <set label='Mary' value='295' tooltext='Mary Evans<BR>Score: 295<BR>Rank:3'/> <set label='Tom' value='523' tooltext='Tom Bowler<BR>Score: 523<BR>Rank:1'/> <styles> <definition> <style name='myHTMLFont' type='font' isHTML='1' /> </definition> <application> <apply toObject='TOOLTIP' styles='myHTMLFont' /> </application> </styles> </chart> |
In the above XML, we're first setting 3 lines tool tip content for each <set>. To separate each line we use the <BR> HTML tag. However, since XML cannot use < and >, so we convert <BR> to <BR> . Thereafter, we need to tell FusionCharts that we'll be displaying HTML content in tool-tip. So, we create a new font style type with isHTML property set to 1 and then apply it to TOOLTIP object. When you now see the chart, you'll get the following output: |
![]() |
| Applying HTML to labels |
| Similarly, if you want to use HTML in data labels, you can do it as shown below: |
| <chart> <set label='John Miller<BR>Score: 420<BR>Rank:2' value='420' /> <set label='Mary Evans<BR>Score: 295<BR>Rank:3' value='295' /> <set label='Tom Bowler<BR>Score: 523<BR>Rank:1' value='523' /> <styles> <definition> <style name='myHTMLFont' type='font' isHTML='1' /> </definition> <application> <apply toObject='DATALABELS' styles='myHTMLFont' /> <apply toObject='TOOLTIP' styles='myHTMLFont' /> </application> </styles> </chart> |
| The above XML will now render the following chart: |
![]() |