Google Answers Logo
View Question
 
Q: Generating graphs in both Flash and PNG ( Answered,   3 Comments )
Question  
Subject: Generating graphs in both Flash and PNG
Category: Computers
Asked by: jjlu-ga
List Price: $100.00
Posted: 11 May 2006 09:00 PDT
Expires: 10 Jun 2006 09:00 PDT
Question ID: 727704
How to generate graphs in both Flash and PNG? For example, if I need
to implement the kind of Flash graph illustrated on
http://finance.google.com/finance?q=google&btnG=Search for client
users, and additionally generate periodic snapshots on the server as
images so that they can be delivered via email, what kind of tools I
will need? I am looking for Linux tools.

Clarification of Question by jjlu-ga on 11 May 2006 14:36 PDT
My goal is to create an image that is a snapshot of what a graph would
look in Flash, but hopefully not have to implement graphing myself.
For example, the static graph from trends looks more or less like the
the Flash version on finance:
://www.google.com/trends?q=google

Request for Question Clarification by leapinglizard-ga on 13 May 2006 12:38 PDT
Let me get this straight. Do you want a procedure to generate Flash
and PNG graphs from your data source? Or do you just want a procedure
to generate PNG files from an existing Flash graph on the web?

leapinglizard

Clarification of Question by jjlu-ga on 14 May 2006 06:28 PDT
I want a procedure to generate Flash and PNG graphs from our data source, and:
 (1) maintain the general look and feel between the Flash and PNG graphs
 (2) implement user interaction for the Flash graph to allow things
like right-click, zooming and panning etc.

Request for Question Clarification by webadept-ga on 15 May 2006 16:55 PDT
Hi, 

Do you want to use Perl or PHP to do this?.. I can show the tools for
either one, or both for that matter.

webadept-ga

Clarification of Question by jjlu-ga on 16 May 2006 07:21 PDT
PHP tools would be fine.
Answer  
Subject: Re: Generating graphs in both Flash and PNG
Answered By: leapinglizard-ga on 17 May 2006 14:51 PDT
 
Dear jjlu,


The only Linux package I have found that generates both Flash and PNG
graphs is the Swiff Chart Generator.

     Swiff Chart Generator is the server-side solution to dynamically
     serve eye-catching animated charts from Active Server Pages
     (ASP), PHP scripts or JSP scripts. Query data from a database,
     apply your own style template created with the Swiff Chart
     authoring tool and instantly generates high-impact charts
     in Macromedia Flash format, PNG/JPG format, SVG format and
     PDF format.

GlobFX: Swiff Chart Generator
http://www.globfx.com/products/swfchartgen/


Swiff Chart Generator is fairly pricey at $899 per server. Moreover,
although the Chart Generator runs on a Linux server to dynamically serve
your graphs, the chart styles have to be designed with a Windows package,
Swiff Chart 3, which costs $149.

GlobFX: Swiff Chart
http://www.globfx.com/products/swfchart/


As a less expensive alternative, you could generate Flash graphs and PNG
graphs from the same data source using two different packages. Of course,
you would have to tweak the respective graph styles to make them resemble
each other as much as possible.


JpGraph uses PHP to generate PNG charts. It is free for personal use
and costs 85 Euros for a single-server commercial license.

JpGraph: Features
http://www.aditus.nu/jpgraph/features.php


Another package for generating PNG charts through PNG is PanaChart,
which is an open-source package and therefore costs zero dollars.

PanaChart: About
http://www.panacode.com/panachart/index.php?SEC=about

PanaChart: Online Demo
http://www.panacode.com/panachart/index.php?SEC=demo


You can use various scripting and programming languages, not just PHP, to
make ChartDirector generate PNG charts. A single-server license costs $99.

Advanced Software Engineering: ChartDirector
http://www.advsofteng.com/product.html

Advanced Software Engineering: ChartDirector Interactive Financial Chart
Sample Code
http://www.advsofteng.com/finance_demo.html


If the chart interactivity offered by JpGraph or ChartDirector isn't
enough for you, and you feel Flash is a necessity, you can generate 
Flash charts with PHP/SWF Charts. This package costs $45 for one domain.

    Use PHP scripts to generate or gather the data from databases, 
    then pass it to this tool to generate Flash (swf) charts and
    graphs. Any other scripting language (ASP, CFML, Perl, etc.) can
    be used with XML/SWF Charts (the XML version of the same tool.)

PHP/SWF Charts: Introduction
http://www.maani.us/charts/index.php?menu=Introduction


Instead of generating the Flash charts with a separate program, you can
automatically convert the PNG charts into Flash with a utility such as
png2swf from the SWF Tools package.

    SWF Tools is a collection of SWF manipulation and creation
    utilities written by Rainer Böhme and Matthias Kramm. It is
    released under the GPL.  Included are:

        [...]

        # PNG2SWF:  Like JPEG2SWF, only for PNGs.

        # GIF2SWF:  Converts GIFs to SWF. Also able to handle
        animated gifs.

        [...]

        # RFXSWF Library:  A fully featured library which
        can be used for standalone SWF generation. Includes
        support for Bitmaps, Buttons, Shapes, Text, Fonts,
        Sound etc. It also has support for ActionScript using
        the  Ming ActionCompiler.

SWF Tools: Home
http://www.swftools.org/


It has been an interesting challenge to answer your question. If you have
any concerns about the accuracy or completeness of my research, please
advise me through a Clarification Request and allow me the opportunity
to fully meet your needs before you rate this answer.

Regards,

leapinglizard


Search strategy:

generate png chart linux
://www.google.com/search?hl=en&lr=&q=generate+png+chart+linux&btnG=Search

flash charting linux
://www.google.com/search?hl=en&lr=&q=flash+charting+linux&btnG=Search

php charting linux
://www.google.com/search?hl=en&lr=&q=php+charting+linux&btnG=Search

png flash convert linux
://www.google.com/search?hl=en&lr=&q=png+flash+convert+linux&btnG=Search

Request for Answer Clarification by jjlu-ga on 17 May 2006 15:23 PDT
Hi leapinglizard,

Thanks for taking the challenge! One thing remains unclear to me:
among the 3 Flash options: (1) Swiff Chart Generator, (2) PHP/SWF
Charts and (3) SWF Tools, can I add/implement custom user interactions
to manipulate the resulting graph? and how (e.g., using the
same/different tool/library)?

Thanks again,
jjlu

Clarification of Answer by leapinglizard-ga on 17 May 2006 20:27 PDT
(1)

Swiff Chart Generator has no interactivity built in. The product FAQ
has this to say about adding Flash interactions to a generated chart.

    Is it possible to insert clickable links in the charts generated
    with Swiff Chart Generator?

    Clickable links insertion is not a built-in feature in Swiff
    Chart Generator. However, since Swiff Chart Generator produces
    Flash movies, the best solution to add some clickable links
    on top of your chart is to embed the chart in a parent Flash
    movie by calling the LoadMovie action script method and to place
    clickable links in the parent Flash Movie itself.

GlobFX: Swiff Chart Generator: FAQ
http://www.globfx.com/support/swfchartgenfaq.php


(2)

PHP/SWF Charts does have built-in support for user interaction. Listed
among its features are the following.

    # Live and interactive chart updates without reloading the
      web page

    # Clickable charts, and drill-down
    
PHP/SWF Charts: Introduction
http://www.maani.us/charts/index.php?menu=Introduction


The FAQ for PHP/SWF Charts mentions one particular way to add
interactivity to charts.

    Allow users to drill-down to get more details. For example, 
    instead of showing data for each day of the year, group and
    average the daily values for each month to end up with just 12
    monthly values. Each could be clicked (using link_data) to show
    the daily values just for the corresponding month.
    
PHP/SWF Charts: FAQ
http://www.maani.us/charts/index.php?menu=FAQ


The documentation for PHP/SWF Charts' link_data attribute provides
further details on implementing chart interaction with PHP or JavaScript.

    link_data's URL should point to a script to process clicks and 
    provide the user with additional information about the clicked
    elements. When the user clicks a chart element, information
    determining which element was clicked is appended to the URL
    before calling it. A script on the other end should read which
    chart element was clicked and process the action accordingly.
    
    [...]
    
    To make a javascript function respond to clicks on chart elements, 
    set link_data's target to "javascript", and set link_data's URL
    to the javascript function like this:

    javascript:function_name(var1, var2, ...)
    
PHP/SWF Charts: Reference: link_data
http://www.maani.us/charts/index.php?menu=Reference&submenu=link_data


The link attribute provides further possibilities for user interaction 
in PHP/SWF Charts.

    Place links over design elements that look like buttons to produce
    functional buttons (see the example below.) These buttons can do
    anything from printing, to jumping to other web pages, to changing
    anything in the chart (like turning off series, changing colors,
    adding or removing data, etc.)

PHP/SWF Charts: Reference: link
http://www.maani.us/charts/index.php?menu=Reference&submenu=link


(3)

If you choose to convert PNG charts into Flash charts using SWF Tools, you
can use the RFXSWF library that comes with SWF Tools to programmatically
add interactive Flash features such as buttons and animation. This
library also lets you hook into the Ming ActionCompiler, so that you
can add any kind of ActionScript to the Flash chart.

    Ming is a C library for generating SWF ("Flash") format movies,
    plus a set of wrappers for using the library from C++ and popular
    scripting languages like PHP, Perl, Python, and Ruby.

Ming: Home
http://ming.sourceforge.net/


leapinglizard
Comments  
Subject: Re: Generating graphs in both Flash and PNG
From: thegreatall-ga on 11 May 2006 13:07 PDT
 
The graph can simply be done in most all server side languages (like
PHP, ASP, CGI, Cold Fusion, exc...). The Flash however can still be
created with one of those lanuages, but completely un-necessary.

You could have Flash import a file and create a graph from that info.
look at this link:
http://finance.google.com/finance/getprices?q=GOOG&p=1Y

That is what the flash imports, it contains all the info needed to
make a graph in flash.

If you have a server side language output something like that, and
have a flash file import it from that site, you could simply get flash
to make a bunch of lines to create a graph.

To get an image out of a graph you could use something like the "gd"
mod to create a graph in a language like php. Then have the php file
output the entire image or save it. Then emailing it would be simple.

Does that help answer your question?
Subject: Re: Generating graphs in both Flash and PNG
From: thegreatall-ga on 11 May 2006 15:47 PDT
 
If I understand correctly, you just want the image of the flash?

Try this:

http://finance.google.com/finance/getchart?q=GOOG&p=3d&i=240

If you disable Flash you will still beable to see the graph, but it is
only a picture...

Is that what you needed?
-ALL
Subject: Re: Generating graphs in both Flash and PNG
From: jjlu-ga on 11 May 2006 16:53 PDT
 
Yes, http://finance.google.com/finance/getchart?q=GOOG&p=3d&i=240 is a
perfect example. I want to generate the image of the Flash on a Linux
server.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy