FusionCharts简单教程(五)-----FusionCharts中的那些特殊符号
在FusionCharts中有些特殊字符,我们需要进行编码操作才能够使用,否则就无法正常显示。
欧元符号
在FusionCharts里显示“€”,你需要用“%80”来替换它。如下:
<graph decimalPrecision='0' numberPrefix='%80 '><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='John'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='420'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Mary'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='295'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Tom'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='523'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码会在数字前面都加上“€”。
英镑符号
在FusionCharts里显示“£”,你需要用“%A3”来替换它。如下:
<graph decimalPrecision='0' numberPrefix='%A3 '><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='John'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='420'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Mary'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='295'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Tom'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='523'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码会在数字前面都加上“£”。
人民币符号
在FusionCharts里显示“¥”,你需要用“%A5”来替换它。如下:
<graph decimalPrecision='0' numberPrefix='%A5 ' ><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='John'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='420'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Mary'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='295'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Tom'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='523'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码会在数字前面都加上“¥”。
分符号
在FusionCharts里显示“¢”,你需要用“%A2”来替换它。如下:
<graph decimalPrecision='0' numberSuffix='%A2 '><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='John'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='420'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Mary'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='295'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Tom'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='523'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码会在数字后面都加上“¢”。
百分号
在FusionCharts里显示“%”,你需要用“%25”来替换它。如下:
<graph decimalPrecision='0' numberSuffix='%25 '><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='John'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='42'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Mary'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='29'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Tom'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='52'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码会在数字后面都加上“%”。
&符号
在FusionCharts里显示“&”,你需要用“&”来替换它。如下:
<graph caption='Total of 2003 & 2004' decimalPrecision='0' ><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='John'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='420'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Mary'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='295'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Tom'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='523'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码标题显示为“Total of 2003 & 2004”。
>符号
在FusionCharts里显示“>”,你需要用“>”来替换它。如下:
<graph decimalprecision='0' ><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='0'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='420'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='0-10'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='295'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='> 10'</span><span style="color: rgb(255,0,0)"> value</span><span style="color: rgb(0,0,255)">='523'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码最后一个数字显示为“>10”。
如果要显示“<”,你可能以为用“<”就可以了,事实是不可能的。我还没试验出怎么才能显示“<”,也许没有这个必要。
单引号
在FusionCharts里显示“'”,你需要用“'”来替换它。如下:
<graph decimalPrecision='0' ><span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='John'</span><span style="color: rgb(255,0,0)">s Count' value</span><span style="color: rgb(0,0,255)">='420'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='AFD8F8'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Mary'</span><span style="color: rgb(255,0,0)">s Count' value</span><span style="color: rgb(0,0,255)">='295'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='F6BD0F'</span> <span style="color: rgb(0,0,255)">/></span> <span style="color: rgb(0,0,255)"><</span><span style="color: rgb(128,0,0)">set </span><span style="color: rgb(255,0,0)">name</span><span style="color: rgb(0,0,255)">='Tom'</span><span style="color: rgb(255,0,0)">s Count' value</span><span style="color: rgb(0,0,255)">='523'</span><span style="color: rgb(255,0,0)"> color</span><span style="color: rgb(0,0,255)">='8BBA00'</span> <span style="color: rgb(0,0,255)">/></span>
</graph>
上面的代码显示为“John's Count”。
如果你想要显示双引号,直接使用就可以了,前提是你的属性值是用单引号括起来的。如果你的属性值是用双引号括起来的,你要显示单引号,也可以直接使用,而不必用“'”来替换它。
-
作者:chenssy。一个专注于【死磕 Java】系列创作的男人
出处:https://www.cnblogs.com/chenssy/p/3662134.html
作者个人网站:https://www.cmsblogs.com/。专注于 Java 优质系列文章分享,提供一站式 Java 学习资料
目前死磕系列包括:
1. 【死磕 Java 并发】:https://www.cmsblogs.com/category/1391296887813967872(已完成)
2.【死磕 Spring 之 IOC】:https://www.cmsblogs.com/category/1391374860344758272(已完成)
3.【死磕 Redis】:https://www.cmsblogs.com/category/1391389927996002304(已完成)
4.【死磕 Java 基础】:https://www.cmsblogs.com/category/1411518540095295488
5.【死磕 NIO】:https://www.cmsblogs.com/article/1435620402348036096
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。