1.amChart for flex 官网地址http://flex.amcharts.com
2.amChart 收费问题:
Q: Can I use amCharts Flex components for free?
A: Yes,the only limitation of the free version is that a small link to this web site will be displayed in the top left corner of your charts.
Q: Will I be able to use these components without a link to this web site after I buy a license?
A: Yes,the link is displayed only in free versions of amCharts.
Q: Will I receive the source code if I purchase a commercial license?
A: The source codes are provided for OEM license buyers.
Q: What are the main rules for the usage of the sources?
A:
1) You can't distribute sources or make them publicly available in any way.
2) You can use sources to create modifications of the products,but not to create new products and distribute them.
3) The sources are provided as they are,without any guarantee that you will understand them.
4) No free support on the topics about sources is provided.
从官网上的介绍可以看出,该组件是免费的,但是在报表的左上角会有一个 chart by amChar.com 的链接。不过这个链接的地址是可以去掉的
,参考如下步骤。
3.amChart去掉链接
以柱状图 <amcharts:AmSerialChart></amcharts:AmSerialChart>为例。
1.创建类Amcharts1继承 AmSerialChart
- public class Amcharts1 extends AmSerialChart
- {
- public function Amcharts1()
- {
- super();
- }
- override protected function createChildren():void{
- super.createChildren();
- if(_amchartsLink){
- _amchartsLink.alpha=0;
- _amchartsLink.width=0;
- _amchartsLink.height=0;
- }
- return;
- }
- }
public class Amcharts1 extends AmSerialChart { public function Amcharts1() { super(); } override protected function createChildren():void{ super.createChildren(); if(_amchartsLink){ _amchartsLink.alpha=0; _amchartsLink.width=0; _amchartsLink.height=0; } return; } }
2.使用Amcharts1
- <mx:VBox width="100%" height="100%">
- <amcharts:AmSerialChart>
- </amcharts:AmSerialChart>
- <amcharts1:Amcharts1
- width="100%"
- height="100%"
- id="chart"
- marginTop="15"
- marginLeft="40"
- marginRight="20"
- dataProvider="{chartData}"
- categoryField="year"
- startDuration="1"
- angle="30"
- depth3D="30">
- <amcharts1:graphs>
- <amcharts:AmGraph title="Income" id="g0" valueField="income" type="column" lineAlpha="0" fillAlphas="[1]"/>
- <amcharts:AmGraph title="Expenses" id="g1" valueField="expenses" type="line" lineThickness="2" bullet="round"/>
- </amcharts1:graphs>
- </amcharts1:Amcharts1>
- <!-- You can position the Legend anywhere you want. Use Flex layout components to do this.
- For example, if you'd like to have your legend on the left or on the right, you should use HBox instead of VBox -->
- <amcharts:AmLegend dataProvider="{chart}" width="100%" marginRight="20" marginLeft="40" textClickEnabled="false" marginBottom="15"/>
- </mx:VBox>
<mx:VBox width="100%" height="100%"> <amcharts:AmSerialChart> </amcharts:AmSerialChart> <amcharts1:Amcharts1 width="100%" height="100%" id="chart" marginTop="15" marginLeft="40" marginRight="20" dataProvider="{chartData}" categoryField="year" startDuration="1" angle="30" depth3D="30"> <amcharts1:graphs> <amcharts:AmGraph title="Income" id="g0" valueField="income" type="column" lineAlpha="0" fillAlphas="[1]"/> <amcharts:AmGraph title="Expenses" id="g1" valueField="expenses" type="line" lineThickness="2" bullet="round"/> </amcharts1:graphs> </amcharts1:Amcharts1> <!-- You can position the Legend anywhere you want. Use Flex layout components to do this. For example,if you'd like to have your legend on the left or on the right,you should use HBox instead of VBox --> <amcharts:AmLegend dataProvider="{chart}" width="100%" marginRight="20" marginLeft="40" textClickEnabled="false" marginBottom="15"/> </mx:VBox>