PHP Flashchart Column Chart Generation example

Source: Internet
Author: User
    1. URL form
    2. function Embswfwithurl (Dataurl,divcon) {
    3. var params = {
    4. "Wmode": "Transparent",
    5. "Menu": "false",
    6. "Scale": "Noscale",
    7. "allowFullScreen": "false",
    8. "allowScriptAccess": "Always",
    9. "bgcolor": "#c0c0c0"//Background
    10. };
    11. var flashvars = {
    12. ' Data-file ': Dataurl
    13. };
    14. swfobject.embedSWF ("/swf/open-flash-chart.swf?timestamp=" + math.random (), Divcon, "" "," "", "10.0.0", "./swf/ Expressinstall.swf ", flashvars,params);
    15. }
    16. Embswfwithurl (' http://xxx.com/xxx.html ', ' Swfcon '); Here the http://xxx.com/xxx.html returns the data in the corresponding JSON format.
Copy Code

Swfcon is a div container that puts Flash. SWFObject is the open source JS processing Flash class: http://code.google.com/p/swfobject/

Note: There are two ways Flash chart obtains data, one for Data-file and the other for Get-data. Data-file just like the example above, the value must be a URL address, which returns JSON data. The value of Get-data is a function name. The function returns the JSON data.

Example:

    1. Get-data
    2. function Embswfwithdata (DIVCON,GETDATAFN) {
    3. var params = {
    4. "Wmode": "Transparent",//Window mode
    5. "Menu": "false",//Menu display
    6. "Scale": "Noscale",//Zoom
    7. "allowFullScreen": "false",//Allow Fullscreen
    8. "allowScriptAccess": "Always",//Allow script
    9. "bgcolor": "#c0c0c0"//Background
    10. };
    11. var Flashvar = {
    12. "Get-data": Getdatafn
    13. };
    14. swfobject.embedSWF ("/swf/open-flash-chart.swf?timestamp=" + math.random (), Divcon, "" "," "," "Ten", "/swf/ Expressinstall.swf ", Flashvar, params);
    15. }
    16. function Getjsondata () {
    17. Return ' JSON data ';
    18. } here "Get-data": Getdatafn
Copy Code
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.