View Full Version : Graph/Chart components
alkoor
07-18-2003, 04:35 PM
I cannot find anything to build graphs and charts with - does Laszlo have it ?
Or it only comes in purchased version ?
In case the answer is negative, any suggestions ?
thanks !
antun
07-18-2003, 09:50 PM
There aren't any graphing/charting APIs at the moment. However it probably be very easy to create your own for simple bar charts. A scattergraph would be quite straightforward too.
Line graphs would be a little bit harder to make, though it is feasable.
To make a simple bar chart you would basically have a "bar" class (or just a simple rectangular colored view), whose height was constrained to a data value.
-Antun
Can you give us a more complete description of your app --- what kind of data are you charting, is the data generated by the server or the client?
If the data is coming from a server file, you could use a third-party server-side chart and graph generator, and request an image from it. (google:chart+graph+java showed me a number of such programs, some open source. I haven't used any of them.) For example, if you've got your chart program set up at http://mydomain.com/chart.jsp, you could render it by using <view resource="http://mydomain.com/chart.jsp?file=source.csv"/> If the data source varies at runtime, you can use the LzView.setSource() method to construct the string at runtime.
If the data is constructed on the client, maybe one of the server-side chart programs lets you pass it as a query parameter.
Sorry I don't have any actual code or a specific server-side chart program to endorse, but let me know if you get anywhere with this, or better yet, tell us where we can look at your app if you get it running!
alkoor
07-21-2003, 09:14 AM
Yes, thanks Antun, I figured about simple bar charts, but I was actually looking for something more advanced - different types (bar, lines, pie - switched on the fly), color preferences, zoom etc.
To OWS: for our purposes we cannot use any server-side components, it all has to be built-in into SWF file. If we wanted to do things on the server, why would we bother with Laszlo at the first place ?
Regaridng server-side charting: I used to build charting apps like that with JHTML and JSP, and I used JChart library from KL-Group (Canada) - it's pretty good. But as I said, I can't go this way again - gotta be something like a built-in Laszlo component or embedded Flash component. I am looking at Macromedia MX components now - they have comprehensive suite of classes for charts, but so far I have no idea how to use from within Laszlo app.
antun
07-21-2003, 01:11 PM
I am looking at Macromedia MX components now - they have comprehensive suite of classes for charts, but so far I have no idea how to use from within Laszlo app.
Laszlo doesn't support MX-specific components, for the simple reason that they only work in the Flash 6 player.
As for the server-side issue, what ows was suggesting was that you do the chart-generation on the server, then load the image at runtime into a Laszlo app - there would be no page refresh - it wouldn't be noticeable that you generated the chart on the server at all.
Take care,
Antun
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.