Make a Chart

I need to make a DLL object which will produce gif or Jpg files of Chart, ie: bar chart, line, etc. The data are from Database. I have no idea how to generate it to a gif or jpg files, because I need it be published to the web site.
Anyone could give me direction?

Regards.
LVL 1
falconewAsked:
Who is Participating?
 
raybeamConnect With a Mentor Commented:
using PSet (PointSet and Direct API calls)
you can some nifty effects if u'r planning to use DirectX 8 DSK as well...Download DirectX 8 SDK, it includes complete documentation on how to create such stuff
0
 
SWEngineerCommented:
Hi Falconew,

There are many server-side components out there that will give you the functionality you are looking to duplicate.

Take a look at the following URL for a list of components:
http://www.aspin.com/home/components/graphics

If you are really set on creating your own, I can provide some direction and assistance if needed. One note the GIF format requires $$$ to license from the vendor.

I will soon be working on a project for a state portal. I am going to use the component from Corda at www.corda.com.

Good Luck!
0
 
SWEngineerCommented:
Hi Falconew,

There are many server-side components out there that will give you the functionality you are looking to duplicate.

Take a look at the following URL for a list of components:
http://www.aspin.com/home/components/graphics

If you are really set on creating your own, I can provide some direction and assistance if needed. One note the GIF format requires $$$ to license from the vendor.

I will soon be working on a project for a state portal. I am going to use the component from Corda at www.corda.com.

Good Luck!
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
falconewAuthor Commented:
Thanks for your response.
I need to make the component myself to be able for me to customize. I know there are many vendors provide the component. But sometimes it doesn't satisfy me for the money I spend. I wish I could make it myself.
0
 
spruce22Commented:
Do you have to generate an image file?  If you're only publishing to the web then you could create a component that would generate HTML from the data.  There'd be some complexity limitations but you could do a lot of neat stuff if you are clever.
0
 
raybeamCommented:
I have a trick...
1st construct the chart using MSChart Control, it's easy if you give me more details I can provide you with some codes, next capture the chart form (you should design it to look as a picture) and save it on a picture file...

if u'r intrested in this method, reply back and I'll post you the routine to captrue a form and save it to a file

Regards,
RayZor
0
 
falconewAuthor Commented:
I need the auto-generated image file, so everytime the user request my website, he will get the recent chart for analysis.
Actually, I don't need the VB form interface, because the Internet browser will be used to display the generated-chart.

Regards.
0
 
raybeamCommented:
I guess you posted this question in the wrong topic area then
0
 
falconewAuthor Commented:
Yup.. I already post it on ASP Area. But no response. So I try to post it here because it still has relation with VB. I don't ask about how to publish it to the web site. I just want to know how to make the dll object to generate the image file so I can published it to the web. So in the process of creating the image, there's no user interaction. When a user call the dll with passing some parameters the image will be generated.
Anyway, Where can I post this such question?

Regards
0
 
raybeamCommented:
why DLL ? VBScript have database connectivity, why don't you use MSChart in your DHTML/ASP Directly ? using Visual Studio it should be a snap...

just a thought...
0
 
raybeamCommented:
another thought...you can use simple tables to create a bar chart, just manupulate the color and height of each cell, you don't even need a Chart Control here...

all depends on how creative you wanna get

Regards,

RayZor
0
 
falconewAuthor Commented:
I know some tricks to make a bar chart using tables. But I need more options on creating the chart, for example: pie, bar, line, etc. So I think, I should make my own dll for reusability next time.
I need to know how to generate the image files?
There are many vendors that sell the chart component. So my question is how do they make it?

Regards.
0
 
falconewAuthor Commented:
Ok, let me check the documentation..
0
 
spruce22Commented:
Just my 2 cents.  Unless you have a specific need other than displaying the graph in a browser I still don't think creating files is the way to go.  Wouldn't DirectX be overkill for bar and line graphs? Anyway - you'd still have to write the file to the web server (and learning the image file format isn't going to be the easiest thing).  
One solution might be to create a Java Applet (for browser compability).  At least it'll do some of the work for you -you'll just have to learn the graphics API and not the file layout, and Java was created for things like this.
Either way the bottom line for me would be that I'd have to have a serious reason and lots of time to implement this functionality on my own.  I'd bet that some of the nicer graph packages will do 90% of what you want, and with the amount of time and cost it would take to develop you could probably buy 5 different packages.
0
 
SWEngineerCommented:
Falconew,

Here some additional information that may be useful. The GIF87a and GIF89a specs can be found on Compuserve's FTP site at ftp://ftp.compuserve.com/ or on the NCSA site at ftp.ncsa.uiuc.edu/misc/file.formats/graphics.formats/

The JFIF specification and the IJG's JPEG Library can be found here: ftp://ftp.uu.net/graphics/jpeg/. The library contains source and samples in C to read and write JFIFs or JPEG data streams.

Hope this helps out a bit ... I took the easy way out and decided to use a commercial library for my graphic needs.

Good luck!
0
 
PaulHewsCommented:
Olectra Chart component has methods to save as jpg or png (png being a more modern file format that has similar properties as gif.)  It also can be used directly on a web page so you could combine it with asp to make charts on the fly from live data on the server.
0
 
PaulHewsCommented:
Here's the URL
http://www.apexsc.com
0
 
SWEngineerCommented:
Falconew,

I forgot to add the Encyclopedia of Graphics File Formats page located at http://www.ora.com/centers/gff/index.htm its a great reference.
0
 
raybeamCommented:
Developing DirectX DLL or OCX with VB is a snap, you have plenty of predefined items, sprites, codes...
it wouldn't take much to develop a nice looking chart using VB and DirectX

or just use Form.PSET methods to create that graph...it's the simplest way ever

RayZor
0
 
PaulHewsCommented:
I would avoid pset and use the GDI API.  Functions like Polygon and Pie are very useful for graphing.  
0
 
raybeamCommented:
Pie and Polygon in VBScript ?
0
 
falconewAuthor Commented:
Many thanks to all of you.
Why I prefer image file to applet or activex for publishing my graphic, because I think it is more efficient and compatible to all browser, besides that the image file can be send as email's attachment to other user. so there are many benefits for choosing image.
it need to be a dll component, so I can use it in VB Script or Visual Basic for the next time.
I need to know how to draw the chart directly to files in gif or jpg format? not to the vb form afterwards capturing it to the files. I agree if I should know the image format. But I need more specific answer in order for me to "PAQ" it so other users can get the answer when opening this issue.
Any help or comment would be appreciated.

Regards,
Falconew
0
 
PaulHewsCommented:
> need to know how to draw the chart directly to files in gif or jpg format?

You will have to draw the picture in memory first, then save it to file.  You can do this with a memory device context (using GDI programming.)  I still think you will need a third party package to save the file to .gif or .png    

Jpg is not appropriate for line graphics and vb is not efficient at bit level manipulation for the compression routines required by these graphic formats.
0
 
spruce22Commented:
Check out
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/ochowCreateaChartUsingRecordset.asp

It's an example of how to use the ms graph activex control from the browser populated by an ADO recordset.  Of course this is ActiveX however, so you would be limited to Internet Explorer, but if you know your user base it would work.  Let me know if you consider this route and I'd help more.
0
 
spruce22Commented:
oops, I hadn't refreshed the page for a while and didn't see your last post where you said no activex.  Nevermind...

As a side note I have a question to the group in general (your graph problem got me thinking).  How often have you guys seen the need for graphs in projects?  Were they web or regular apps? Thanks in advance.
0
 
PaulHewsCommented:
>How often have you guys seen the need for graphs in projects?  Were they web or regular apps? Thanks in
advance.

I need it a lot, but then I write a lot of reporting programs.  Desktop and web although we're cheating on our web reports using Excel.
0
 
spruce22Commented:
If you can settle for the MS chart then this should give you what you need.  Basically you give the chart some data and tell it to create the gif and that's it.  And it's COM so you can make your own DLL to wrap the functionality if you want.


http://support.microsoft.com/support/kb/articles/Q244/0/49.ASP
0
 
falconewAuthor Commented:
Thanks for your response.
But I need to make MS chart-like DLL. I need so because I could program and customize myself. It's more flexible if I know how to write the chart directly to files or buffer.
0
 
MoondancerCommented:
Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20177993.html
http://www.experts-exchange.com/questions/Q.20255693.html
http://www.experts-exchange.com/questions/Q.20266604.html




PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0
 
raybeamCommented:
That's more like it :D
0
 
MoondancerCommented:
falconew logged in 3/21/02 and CHOSE NOT TO RESPOND here, which I find very disheartening.  Help requested, great help given and then ....... nothing.

I am finalizing this now.  If questions, please comment.

Moondancer - EE Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.