posts - 13,comments - 19,trackbacks - 0
Flex Chart 技巧 - 移除浮水印 (中国人真聪明啊!)
Flex Chart 雖然有提供完整的試用功能
不過編譯完成的圖表會加上浮水印
Flex Data Visualization Trial

以上的浮水印其實是以 AS3 動態加上的

既然是 AS,那事情就簡單了
只要在 Flex Project 內自行加上以下 Class
  • package mx.charts.chartClasses {
  •  public class ChartsLicenseHandler {
  •  }
  • }
  •  

    然後在 MXML 內明確引用該 Class,或是用 Metadata Tag 強迫編譯
    這樣就可以去除浮水印了~!

    1. <?xml version="1.0"?>
    2. <mx:Application backgroundColor="#DDDDDD"
    3.   xmlns:mx="http://www.adobe.com/2006/mxml">
    4.  <mx:Script>
    5.   <![CDATA[
    6.   
    7.   [Frame(extraClass="mx.charts.chartClasses.ChartsLicenseHandler")]
    8.   
    9.   import mx.collections.ArrayCollection;
    10.   
    11.   [Bindable]
    12.   private var expensesAC:ArrayCollection = new ArrayCollection( [
    13.    { Month: "Jan", Profit: -200, Expenses: 1500, Amount: 500 },
    14.    { Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
    15.    { Month: "Mar", Profit: 1500, Expenses: -500, Amount: 300 } ]);
    16.   ]]>
    17.  </mx:Script>
    18.  
    19.  <mx:SolidColor id="sc1" color="blue" alpha=".3"/>
    20.  <mx:SolidColor id="sc2" color="red" alpha=".3"/>
    21.  <mx:SolidColor id="sc3" color="green" alpha=".3"/>
    22.  
    23.  <mx:Stroke id="s1" color="blue" weight="1"/>
    24.  <mx:Stroke id="s2" color="red" weight="1"/>
    25.  <mx:Stroke id="s3" color="green" weight="1"/>
    26.  
    27.  <mx:Panel title="PlotChart Control Example" height="100%" width="100%">
    28.   <mx:PlotChart id="plot" height="100%" width="100%"
    29.     paddingLeft="5" paddingRight="5"
    30.     showDataTips="true" dataProvider="{expensesAC}" >
    31.    <mx:series>
    32.     <mx:PlotSeries xField="Expenses" yField="Profit"
    33.      displayName="Plot 1" fill="{sc1}" stroke="{s1}" />
    34.     <mx:PlotSeries xField="Amount" yField="Expenses"
    35.      displayName="Plot 2" fill="{sc2}" stroke="{s2}" />
    36.     <mx:PlotSeries xField="Profit" yField="Amount"
    37.      displayName="Plot 3" fill="{sc3}" stroke="{s3}" />
    38.    </mx:series>
    39.   </mx:PlotChart>
    40.  </mx:Panel>
    41. </mx:Application>
    posted on 2009-02-27 15:20 南山隐士 阅读(2166) 评论(3)  编辑  收藏

    FeedBack:
    # re: Flex中如何去掉水印(转帖)[未登录]
    2009-04-23 10:17 | 菜鸟
    大侠救命啊,我是菜鸟,急!!!

    我照你说的弄,可是第7行[Frame(extraClass="mx.charts.chartClasses.ChartsLicenseHandler")]
    有个错误:Metadata requires an associated definition.  回复  更多评论
      
    # re: Flex中如何去掉水印(转帖)
    2009-05-06 13:04 | 南山隐士
    @菜鸟
    mx.charts.chartClasses.ChartsLicenseHandler
    这是一个类,你建这么一个类就可以了,里面什么都不用写  回复  更多评论
      
    # re: Flex中如何去掉水印(转帖)
    2011-03-04 19:18 | 地方
    @南山隐士
    那是空的类啊,什么都么写啊,也报那个错呢。  回复  更多评论
      

    只有注册用户登录后才能发表评论。


    网站导航: