Jump to content
Sign in to follow this  

Graph data

Recommended Posts


Hi Guys

I'm going to try and grab some data from a SQL database table and display visually on AutoIt GUI as a line graph. I'll refresh this every hour or so. Firstly, is this possible? If so, what's the best way to read the data in order to build X and Y axis and also plot the points? ( I know how to do the SQL bit... more interested in the graphing side)

My data will look like this:

Time | Value

9 - 10 | 1420

10 - 11 | 1100

Appreciate any pointers =)


Edited by kiffab

Share this post

Link to post
Share on other sites


I have used the GraphGDIPlus UDF very successfully to graph data. :)


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

Hi M23

Are there working examples of this? It looks like what I need but not quite sure how to use it. How would I get my data range, for example?


Share this post

Link to post
Share on other sites

Sorry, I just downloaded the file. I'll have a look at this :)

Share this post

Link to post
Share on other sites

Ok, so far I have pulled data from SQL table in order to build the x and y axis. I am using max and min values to determine values for x as this will be a time.

$conn = ObjCreate( "ADODB.Connection" )
$DSN = "DRIVER={SQL Server};SERVER=Server1;DATABASE=DB1;UID=hello;PWD=12345;"

$RS1 = ObjCreate("ADODB.RecordSet")

$RS1.Open("SELECT min(hour) 'min' FROM DB1.dbo.events", $conn)

If $RS1.RecordCount Then
    While Not $RS1.EOF
        $minX = $RS1.Fields("min").value & "00"

I then use this:


I was then planning to use a SQL statement to identify each point since there will only be one for each hour of the day between 9 and 5.

I'd then plot these points and join the dots.

Does that seem like a sensible way to do things or should I have less SQL interaction? i.e. query db, write to array, use content.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this