open-flash-char 饼图的百分比如何显示
如图中的 百分比要如何正确显示
我的代码如下:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<script type="text/javascript" src="JS/open-flash-chart/swfobject.js"></script>
<div id="my_chart"></div>
<script type="text/javascript">
var so = new SWFObject("JS/open-flash-chart/open-flash-chart.swf", "ofc", "300", "300", "9", "#FFFFFF");
//so.addVariable("data", "../data-files/data-20.txt");
so.addVariable("variables","true");
so.addVariable("pie", "60,#9933CC,#000000");
so.addVariable("values", "
3,2,1,1,1,1,0.2");
so.addVariable("colours", "#d01f3c,#356aa0,#C79810");
so.addVariable("links", "javascript:alert('Jan 3'),javascript:alert('中文 2'),javascript:alert('March 1'),javascript:alert('April 1'),javascript:alert('May 1'),javascript:alert('June 1'),javascript:alert('July 0.2')");
so.addVariable("pie_labels", "January,中文,March,April,May,June,July");
so.addVariable("tool_tip","#x_label#<br>Value: #val#<br> <br>
#val#%25");
so.addParam("allowScriptAccess", "always" );//"sameDomain");
so.write("my_chart");
</script>
用了#val#%25根本就不能正确显示百分比啊,除非so.addVariable("values","3,2,1,1,1,1,0.2");这句话中,values的值总和为100
求高手指教啊!!
这个
so.addVariable("tool_tip",""); 里面的百分比到底要怎么写啊
------解决方案--------------------#val# / #total#<br>占百分比 #percent#
用这个试试吧。
------解决方案--------------------查下API咯
------解决方案--------------------
PieChart pie = new PieChart();
pie.setTooltip( "#val# / #total#<br> 占百分之 #percent#");//
http://hi.baidu.com/dongfangjack/item/c7de1531a8c89486c2cf29a2
------解决方案--------------------so.addVariable("tool_tip", "#x_label#<br>#key#:#val#%")
用这个试试吧