Jump to content
Sign in to follow this  

Whats the best way to store graph data for a redraw?

Recommended Posts


Hi Guys

In my last thread I asked at the end how/where should I store the previous graph data so when the X or Y adjusts I can redraw the full graphed data, I had no replies so thought I would ask in a fresh thread.

Currently I just keep adding to an array but as it grows the tool slows down, is there a better way. I've seen other software graphs that just grow and grow, what's best for Autoit?

PS, this is the thread '?do=embed' frameborder='0' data-embedContent>> in short, using GraphGDIPlus.au3 as the graph goes past the set X or Y the X or Y change by growing, problem was that if it grew the graph redraw drew a flat line before carrying on, so I added all values to an array but this slows it down.

Share this post

Link to post
Share on other sites

This code comes from the helpfile and is quite usable with an array - even a big one

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

    GUICreate("My Draw", 300, 150)

    $a = GUICtrlCreateGraphic(20, 20, 200, 100)
    GUICtrlSetBkColor(-1, 0xffffff)
    GUICtrlSetGraphic(-1, $GUI_GR_HINT, 2)

    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 10, 80)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, 40, 50)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, 70, 60)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, 100, 30)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, 130, 40)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, 160, 30)


    While 1
    $msg = GuiGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit

Share this post

Link to post
Share on other sites

Thanks for the reply but I don't see how this can help me in my situation, I take it you have looked at the other thread?

I am drawing a graph (not graphic) the graph changes after each data entry, problem arises when the graph X or Y has to be extended, I store the old data points in an array but this slows down eventually, I am asking for the best way to redraw the graph if the graph needs extending to avoid the flat line appearing after the redraw.

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