使用amCharts工具做报表的小记 flash报表 饼图 柱状图 折线图

用amcharts做报表工具时,遇到了好几个小问题。第一是破解问题,如果不破解amcharts的LOGO图标就会显示在flash上面,让人感觉非常不好。第二个就是关于XXX_setting.xml中小数点的问题,如果你在data.xml文件中的数据是12.56,那么默认情况下在flash中显示的是12,56,它用逗号代替了小数点。网上搜索半天,终于找到方法。

第一个比较简单,网上很多,但我就用了其中最简单的一种,就是在amcharts目录下找到amcharts_key.txt,输入AMCHART-LNKS-1966-6679-1965-1082保存,LOGO问题解决。

第二个在你的XX_setting.xml文件中,找到<decimals_separator></decimas_separator>,写上.就可以了。


饼图颜色设置:
如果不想使用默认的颜色的话 那么可以自己来设置颜色
例如一个饼图分3块 则需要3个颜色来分别表示这些图形
就需要在setting.xml文件中加上
< pie >
   
< colors > FF9E01,F8FF01,B0DE09 </ colors >   // 设置颜色
    < x > 320 </ x >
   
< y > 100 </ y >
   
< radius > 100 </ radius >
   
< inner_radius > 30 </ inner_radius >
   
< height > 10 </ height >
   
< angle > 35 </ angle >
   
< alpha > 90 </ alpha >
 
</ pie >

柱状图的颜色设置:
   < graphs >
    
< graph gid = " 0 " >
      
< color > FEC514 </ color > // 设置颜色
     </ graph >
  
</ graphs >

柱状图的 柱子宽度设置
  < column >
    
< width > 20 </ width > // 设置宽度 
     < balloon_text > {value} </ balloon_text >
    
< grow_time > 3 </ grow_time >
  
</ column >



柱状图的虚线背景想要取消怎么办 
请看代码 我们也可以设置背景为白色框 什么都不加
   < grid >
    
< category >
      
< alpha > 0 </ alpha >   // 设置成0 当然不为0就有虚线
       < dashed > 1 </ dashed >
    
</ category >
    
< value >
      
< alpha > 0 </ alpha > // 设置成0 当然不为0就有虚线
       < dashed > 1 </ dashed >
    
</ value >
  
</ grid >

图形页面的边距

    < plot_area >
    
< margins >
      
< left > 50 </ left >
      
< left > 25 </ left >
      
< right > 20 </ right >
      
< top > 20 </ top >
      
< bottom > 60 </ bottom >
    
</ margins >
  
</ plot_area >

鼠标移到图形时 显示图形代表块的数据
  < column >
    
< width > 20 </ width >
    
< balloon_text > {titile} : {value}  ( {percents} % ) balloon_text >   // 这三个参数可以取舍 第一个是显法标题,第二个是显示具体值,第三个是百分比
     < grow_time > 3 </ grow_time >
  
</ column >

没有数据时图形的显示
    1 没有数据时可以显示一个默认图形 这个自己定义 想显示成什么样就什么样 看需求了
    2 没有数据时 有的用户希望有一个友好的提示 所以请看提示功能
   
< strings >
    
< no_data > 没有数据 </ no_data >
</ strings >


小数点的形式
   < thousands_separator > , </ thousands_separator >
  
< decimals_separator > . </ decimals_separator >

整个图形的宽度与高度 即图形大小了
呵呵 
new  SWFObject(swfURI, chartType,  " 100% " , chartHeight,  " 7 " "" ); // 第三个参数是宽度  第四个是高度  

设置标题栏的位置 默认是在左下方 图形的下方 这此的需求是放在上方
/*这是默认的设置 可以在legnd里面加上自定义x y 的值*/  
  
< legend >
    
< enabled > 0 </ enabled >
  
</ legend >
/*自定义 标题栏的位置*/
   
< legend >
    
< x > 15 </ x >
    
< y > 5 </ y >
  
</ legend >
如果是pie 饼图的话 enable应设为true才会显示
  <legend>
    <align>center</align>
  </legend>

如果柱状图 不是柱状 而成了四边形 不是柱子形 此时也是需要设置的 
   < depth > 20 </ depth >   // 设置柱子形状 如果值为0 你可试试 就不是柱状 而是四边形
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
xml <!-- [xml] (xml / csv) 数据类型xml/csv--> ; <!-- 如果使用csv作为数据的话,需要使用这个属性;表示文件数据分隔符,(平常以";"和","为主) [;] (string) csv file data separator (you need it only if you are using csv file for your data) --> 1 <!-- 如果使用的是csv数据,可以设置跳过几行再显示数据,默认为0表示csv中的数据全部显示,大于n(n>0);表示前面n行都不显示[0] (Number) if you are using csv data type, you can set the number of rows which should be skipped here --> <!-- 设置系统中的字体[Arial] (font name) use device fonts, such as Arial, Times New Roman, Tahoma, Verdana... --> <!-- 设置所有文本的大小,默认为11,具体的文本的字体大小也可以在下面的设置中设置[11] (Number) text size of all texts. Every text size can be set individually in the settings below --> <!-- 同上[#000000] (hex color code) main text color. Every text color can be set individually in the settings below--> . <!-- 小数分隔符,默认为[,]注:该属性只是用来显示,而在csv数据文件中,必须使用[.] (string) decimal separator. Note, that this is for displaying data only. Decimals in data xml file must be separated with a dot --> <!-- 千位分隔符,默认为空[ ] (string) thousand separator. use "none" if you don't want to separate --> 3 <!-- 如果百分数格式的数字,后面的小数位小于该属性的值,则在小数后面加0补充。如54.2%,该属性设置为3,那么显示的效果为54.200%。[] (Number) if your value has less digits after decimal then is set here, zeroes will be added --> <!--设置科学记数法的最小值 [0.000001] If absolute value of your number is equal or less then scientific_min, this number will be form
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值