PDA

View Full Version : Data driven graphics


jwray
10-07-2004, 09:09 AM
Hi,

I'm currently evaluating Laszlo's RIA solution and so far liking what I see. However, there's one potential sticking point for adoption that I can see. I currently use a lot of data driven graphics. That is bar charts, scatter plots and other more unique graphical representations of our data. I use SVG embedded in a html page for this as it provides the ability to add links to graphical objects, pop-ups and other animatations for specific objects.

So my question is, how would I do such a thing in a Laszlo based application?

thanks a lot,
Jonny

antun
10-07-2004, 10:07 AM
The ability to load graphics and display them at run-time is built into the fundamental building block of Laszlo, <view>.

You can call setSource( "myimg.gif" ) on a view to load myimg.gif at run-time, and the image url can easily come from a dataset.

Check out the Amazon application (http://www.laszlosystems.com/lps/sample-apps/amazon/amazon2.lzx?lzt=html) - it loads an XML dataset to get the music recommendations, then loads the CD cover images based on that data.

-Antun

jwray
10-07-2004, 10:28 AM
Thanks for the reply, I was aware of the image loading capabilities.

I guess my question still stands, so I'll try to rephrase it. Take, for example, the requirement to produce a bar chart (or any other image) from data held in the database. I can create a servlet to do this and thus load an image that way. That I have no problem with. But, I also need to have this image be interactive. As in, when a user hovers over a bar a popup appears giving details on the data making up that bar. When the user clicks on the bar, other actions happen.

As I mentioned, I currently use SVG to do this but I don't see how I can get this interaction with dynamic generated images using Laszlo.


Originally posted by antun
The ability to load graphics and display them at run-time is built into the fundamental building block of Laszlo, <view>.

You can call setSource( "myimg.gif" ) on a view to load myimg.gif at run-time, and the image url can easily come from a dataset.

Check out the Amazon application (http://www.laszlosystems.com/lps/sample-apps/amazon/amazon2.lzx?lzt=html) - it loads an XML dataset to get the music recommendations, then loads the CD cover images based on that data.

-Antun

antun
10-07-2004, 10:35 AM
I see what you mean. There's a very simple example here:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=718&highlight=bar+chart

You could write interactivity into a column class, for example to allow the user to change the height (and the underlying data) of a column, etc.

-Antun

jwray
10-07-2004, 11:07 AM
Thanks for the example. Unfortunatley, our cases fall into the more complex situation you mentioned. We currently use charting libraries to generate graphs of our data, or our home grown libraries to produce some rather specific views.

It looks like that to have such functionality in Laszlo would require the development of a graphic/charting library, that could produce complex charts with bound data and have embedded actions in them.

Originally posted by antun
I see what you mean. There's a very simple example here:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=718&highlight=bar+chart

You could write interactivity into a column class, for example to allow the user to change the height (and the underlying data) of a column, etc.

-Antun

d~l
10-07-2004, 01:14 PM
As I've suggested in other threads .. can't you use embedded SVG objects for your interactive charts?

Usual downside .. SVG plug-in required .. but it is an easy instal.

jwray
10-07-2004, 02:31 PM
Hmm,

Are you saying I can embed an SVG object within a Lazslo application? And the embedded svg can have action listeners that can talk to the Laszlo system?
If so, any reference on how to do this? I agree, if this is possible then it would be a good solution.

The client install wouldn't be a problem for me currently, I'm using it already.



Originally posted by d~l
As I've suggested in other threads .. can't you use embedded SVG objects for your interactive charts?

Usual downside .. SVG plug-in required .. but it is an easy instal.