AnyChart使用指南三:生成动态图像
2012-11-21 14:59
423 查看
AnyChart主要工作原理是有一个.swf文件作为对象,数据和设置存放在.xml文件中,然后在.html文件里通过JS来调用,生成动态图像。
由于想使用到struts中去,xml文件自动生成,有个叫jdom的包能够实现这样的功能,于是在网上找jdom的使用教程,终于写好了第一个生成xml的java文件,示例代码如下:
生成的xml文件如下:
由于想使用到struts中去,xml文件自动生成,有个叫jdom的包能够实现这样的功能,于是在网上找jdom的使用教程,终于写好了第一个生成xml的java文件,示例代码如下:
<?xml version="1.0" encoding="gb2312"?> <root> <type> <system> <refresh enabled="yes" /> </system> <workspace> //整个工作区 <background enabled="yes" type="gradient" gradient_type="linear"> <colors> <color>0xFFFFFF</color> <color>0xF4E1C4</color> </colors> <alphas> <alpha>100</alpha> <alpha>100</alpha> </alphas> <ratios> <ratio>0</ratio> <ratio>0xFF</ratio> </ratios> <matrix r="1.7" /> </background> <chart_area width="400" height="240" x="20" y="30" enabled="no" /> <base_area enabled="no" /> </workspace> <chart type="3DPie"> //输出图形部分 <animation enabled="yes" speed="10" type="step" /> <names show="no" /> <values show="no" postfix="%" /> <pie_chart radius="100" x="340" y="150" rotation="360"> <border enabled="yes" color="0xF4E1C4" /> </pie_chart> <hints width="170"> <border color="0xB54001" /> <background background="0xF4E1C4" /> </hints> </chart> <legend enabled="yes" x="22" y="60"> //输出文字部分 <background enabled="no" /> <border enabled="no" /> <scroller enabled="no" /> <names width="120" /> <values width="40" /> <header values="%" names="Name" /> </legend> </type> <data> <block> <set name="column 0" value="4" color="0xAFD8F8" /> <set name="column 1" value="17" color="0xAFD8F8" /> </block> </data> <objects> <text text="sillyPieChart" auto_size="yes" x="20" y="380" url="./pieChart.xml"> <font size="12" align="center" type="Verdana" /> <border enabled="no" /> </text> </objects> </root>
相关文章推荐
- ASP.NET Core 中文文档 第二章 指南 (09) 使用 Swagger 生成 ASP.NET Web API 在线帮助测试文档
- 使用WPF动态生成Code 39条形码
- android动态生成表格,使用的是TABLELAYOUT
- 使用PHP生成二维码的两种方法(带logo图像)
- 使用PHP生成二维码的两种方法(带logo图像)
- ASP.NET动态生成GridView的使用
- 使用VTemplate模板引擎动态生成订单流程图
- MVC3 使用动态生成的DropDownList,更新partial view
- 使用GridView做出列选择效果(获取动态生成的控件.鼠标点选GridView.Ajax控件)
- 动态生成的html中无法使用jquery事件的解决方法
- jQuery使用on()绑定动态生成元素的事件无效的问题
- 使用random模块,生成动态随机密码
- 使用QT搭建点云显示框架系列五·基于QT的QML图像选点、动态绘制十字丝功能 ,以及纹理映射
- Android使用第三方已经生成的动态SO库 (解决银联崩溃)
- 使用原生js动态生成Select,根据前面的Select的option生成二级Select
- 使用asp动态生成页面,并将页面保存为word
- 使用PHP生成二维码的两种方法(带logo图像)
- linux shell 动态生成 数组系列 seq使用技巧
- 使用javaassist在内存中动态生成类
- 使用ABP实现SwaggerUI,生成动态webapi