Fuzz
Fuzz

Reputation:

Draw graphs in VBscript

I have a HTML application, partially HTML, partially VBscript, disguised as a form. What it does is it opens a few local files, runs a DOS box containing GAWK and presents a text file as its result. I wish to expand upon it by letting it create a bitmap image with the results in a stacked bar graph, for instance as a .BMP file. But I'm stumped. I haven't the faintest idea where to start.

Upvotes: 1

Views: 8515

Answers (5)

Antoni Gual Via
Antoni Gual Via

Reputation: 763

Well, in 2022 an answer could be to build from scratch an html file with svg commands then open it in the default browser.

Upvotes: 0

mrTomahawk
mrTomahawk

Reputation: 962

The Microsoft Scripting Guys came out with an article which discussed his quite a while ago, but it involves using the Excel ActiveX control or the OWC control the article is really detailed in how to do it, look here: http://www.microsoft.com/technet/scriptcenter/topics/activex/chart.mspx

Upvotes: 0

Sandeep Datta
Sandeep Datta

Reputation: 29345

I believe you will be able to use this library http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm in VBScript too. It can be used to draw all kinds of shapes lines, rectangles, circles etc

Once you have drawn the graph you can print the page to a PDF printer (like cutePDF) to get the image onto a file for later use.

Upvotes: 0

Tomalak
Tomalak

Reputation: 338326

Graphics are beyond the capabilities of VBScript alone. You can try if you find an ActiveX/COM component that can do it for you. Looking into Google, my guess is that most of them come as dumbed-down trial versions of quite expensive commercial products. Maybe someone else here knows one that is for free.

As an alternative route, you could set up a web service somewhere that does the image processing (for example PHP/gdlib) using URL parameters. Then you would just have to link to the image in your HTA with an <img> tag like you normally would.

Upvotes: 0

seanb
seanb

Reputation: 6954

Is javascript an option? That would be a lot easier than creating an image file.

I have used this jquery plugin http://code.google.com/p/flot/ a few times and works well.

I have not used VBScript for a few years now, think you would probably need to use an active-x object of some kind to generate an image file, but I could be wrong there.

Upvotes: 4

Related Questions