Solved

Make a Chart

Posted on 2001-09-03
31
455 Views
Last Modified: 2008-02-07
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.
0
Comment
Question by:falconew
  • 8
  • 7
  • 5
  • +3
31 Comments
 

Expert Comment

by:SWEngineer
ID: 6452229
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
 

Expert Comment

by:SWEngineer
ID: 6452235
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
 
LVL 1

Author Comment

by:falconew
ID: 6452295
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
 
LVL 1

Expert Comment

by:spruce22
ID: 6452392
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
 
LVL 1

Expert Comment

by:raybeam
ID: 6452495
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
 
LVL 1

Author Comment

by:falconew
ID: 6452546
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
 
LVL 1

Expert Comment

by:raybeam
ID: 6452628
I guess you posted this question in the wrong topic area then
0
 
LVL 1

Author Comment

by:falconew
ID: 6452726
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
 
LVL 1

Expert Comment

by:raybeam
ID: 6452774
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
 
LVL 1

Expert Comment

by:raybeam
ID: 6452777
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
 
LVL 1

Author Comment

by:falconew
ID: 6455307
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
 
LVL 1

Accepted Solution

by:
raybeam earned 300 total points
ID: 6455638
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
 
LVL 1

Author Comment

by:falconew
ID: 6456466
Ok, let me check the documentation..
0
 
LVL 1

Expert Comment

by:spruce22
ID: 6458017
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
 

Expert Comment

by:SWEngineer
ID: 6458031
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 38

Expert Comment

by:PaulHews
ID: 6458058
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
 
LVL 38

Expert Comment

by:PaulHews
ID: 6458061
Here's the URL
http://www.apexsc.com
0
 

Expert Comment

by:SWEngineer
ID: 6458096
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
 
LVL 1

Expert Comment

by:raybeam
ID: 6458297
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
 
LVL 38

Expert Comment

by:PaulHews
ID: 6458329
I would avoid pset and use the GDI API.  Functions like Polygon and Pie are very useful for graphing.  
0
 
LVL 1

Expert Comment

by:raybeam
ID: 6458354
Pie and Polygon in VBScript ?
0
 
LVL 1

Author Comment

by:falconew
ID: 6459366
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
 
LVL 38

Expert Comment

by:PaulHews
ID: 6459377
> 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
 
LVL 1

Expert Comment

by:spruce22
ID: 6459379
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
 
LVL 1

Expert Comment

by:spruce22
ID: 6459389
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
 
LVL 38

Expert Comment

by:PaulHews
ID: 6459398
>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
 
LVL 1

Expert Comment

by:spruce22
ID: 6459905
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
 
LVL 1

Author Comment

by:falconew
ID: 6469473
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
 
LVL 1

Expert Comment

by:Moondancer
ID: 6861687
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
 
LVL 1

Expert Comment

by:raybeam
ID: 6890063
That's more like it :D
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6891750
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now