Jump to content

Graph API


Recommended Posts

Sample URL

http://bitworking.org/projects/sparklines/...;min-color=blue

API SITE

I will be building on this. but there are three types. The smooth type is done.

UPDATE:

All three graph types are available, the next thing I will do is write documentation.

Let me know what you think

;smoothgraph("34,23,12,55,1,12,54,87",50,30, "0,100", "red")
Func smoothgraph($data, $height, $step=-1, $limits=-1, $minmarker=-1, $maxmarker=-1, $lastmarker=-1)
    $url = "http://bitworking.org/projects/sparklines/spark.cgi"
    $url = $url & "?type=smooth"
    $url = $url & "&d=" & $data
    If $height <> -1 Then $url = $url & "&height=" & $height
    If $step <> -1 Then $url = $url & "&step=" & $step
    If $limits <> -1 Then $url = $url & "&limits=" & $limits
    If $minmarker <> -1 Then $url = $url & "&min-m=" & "true&min-color=" & $minmarker
    If $maxmarker <> -1 Then $url = $url & "&max-m=" & "true&max-color=" & $maxmarker
    If $lastmarker <> -1 Then $url = $url & "&last-m=" & "true&last-color=" & $lastmarker
    Return $url
EndFunc

;discretegraph("34,23,12,55,1,12,54,87", 50, 20, "0,100", 40, "pink", "brown")
Func discretegraph($data, $height, $width, $limits, $threshhold, $upper="red", $lower="gray")
    $url = "http://bitworking.org/projects/sparklines/spark.cgi"
    $url = $url & "?type=discrete"
    $url = $url & "&d=" & $data
    If $width <> -1 Then $url = $url & "&width=" & $width
    If $height <> -1 Then $url = $url & "&height=" & $height
    If $limits <> -1 Then $url = $url & "&limits=" & $limits
    If $threshhold <> -1 Then $url = $url & "&upper=" & $threshhold
    If $upper <> -1 Then $url = $url & "&above-color=" & $upper
    If $lower <> -1 Then $url = $url & "&below-color=" & $lower
    Return $url
EndFunc

;impulsegraph("34,23,12,55,1,12,54,87", 50, 20, "0,100", 40, "pink", "brown")
Func impulsegraph($data, $height, $width, $limits, $threshhold, $upper="red", $lower="gray")
    $url = "http://bitworking.org/projects/sparklines/spark.cgi"
    $url = $url & "?type=impulse"
    $url = $url & "&d=" & $data
    If $width <> -1 Then $url = $url & "&width=" & $width
    If $height <> -1 Then $url = $url & "&height=" & $height
    If $limits <> -1 Then $url = $url & "&limits=" & $limits
    If $threshhold <> -1 Then $url = $url & "&upper=" & $threshhold
    If $upper <> -1 Then $url = $url & "&above-color=" & $upper
    If $lower <> -1 Then $url = $url & "&below-color=" & $lower
    Return $url
EndFunc

If anyone would like to finish, be my guest. I have to run to work. Feed back is welcome.

Thanks

Edited by CyberZeroCool

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Very nice :whistle: I could see people doing databases in AutoIt with this now.

Thank you

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

You have just saved me a lot of work.

For months now I've been thinking of functions to create charts.

I was looking at the chart.dll and I just dreaded the thought of getting started.

Thanks a bunch.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

You have just saved me a lot of work.

For months now I've been thinking of functions to create charts.

I was looking at the chart.dll and I just dreaded the thought of getting started.

Thanks a bunch.

Thanks, I'm glad I could help.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Updated. Please check first post.

Thank you,

CyberZeroCool

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

@all

Graphs have allways been around ?

Nevertheless not that nice as you demonstrated of cource

#include "GUIConstants.au3"
    
$MAXGr=7
Global $a[$MAXGr+1] ; 0 and $MAXGr entries not used to allow GUICtrlDelete result
Global $child, $del

GUICreate("My Main", -1,-1,100,100)
$del1=GuiCtrlCreateButton("Delete", 50,200, 50)
GUISetState()
CreateChild()

$i=1
$inc=1
;$i=5   ; uncomment to delete starting from last define Graphic control
;$inc=-1

Do
    $msg = GUIGetMsg()
    if $msg= $del1 then Del()

    if $msg= $del then
        GuiCtrlDelete($a[$i])
        $i = $i+$inc
        if $i <0 OR $i>$MAXGr then exit
    EndIf
Until $msg=$GUI_EVENT_CLOSE

Func Del()
    GuiDelete($child)
    CreateChild()
EndFunc

Func CreateChild()
$child=GUICreate("My Draw")
$del=GuiCtrlCreateButton("Delete", 50,165, 50)

$a[1]=GuiCtrlCreateGraphic(20, 50, 100,100)
GUICtrlSetBkColor(-1,0xffffff)
GUICtrlSetColor(-1,0)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000,0xff0000)
GUICtrlSetGraphic(-1,$GUI_GR_PIE, 50,50, 40,30,270)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x00ff00,0xffffff)
GUICtrlSetGraphic(-1,$GUI_GR_PIE, 58,50, 40,-60,90)

GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 100,100, 50,80)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x00ff00,0xc0c0ff)
GUICtrlSetGraphic(-1,$GUI_GR_RECT, 350,200, 50,80)
GuiCtrlCreateLabel("label", 65, 100, 30)
GUICtrlSetColor(-1,0xff)

$a[2]=GuiCtrlCreateGraphic(220, 10, 100,100)

GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0, 0xff)
GUICtrlSetGraphic(-1,$GUI_GR_PIE, 50,50, 40,30,270)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x00ff00,0xffffff)
GUICtrlSetGraphic(-1,$GUI_GR_PIE, 58,50, 40,-60,90)

$a[3]=GuiCtrlCreateGraphic(220, 110, 100,100)
GUICtrlSetBkColor(-1,0xf08080)
GUICtrlSetColor(-1,0xff)
GUICtrlSetGraphic(-1,$GUI_GR_HINT, 1)

GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff00ff)
GUICtrlSetGraphic(-1,$GUI_GR_RECT, 50,50, 80,80)

$a[4]=GuiCtrlCreateGraphic(20, 200, 80,80)
GUICtrlSetBkColor(-1,0xffffff)
GUICtrlSetGraphic(-1,$GUI_GR_HINT, 1)

GUICtrlSetGraphic(-1,$GUI_GR_MOVE, 10,10)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 30,40)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff00)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 70,70)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 10,50)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xffff00)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 10,10)

$a[5]=GuiCtrlCreateGraphic(150, 10, 50,50)
GUICtrlSetBkColor(-1,0xa0ffa0)
GUICtrlSetGraphic(-1,$GUI_GR_MOVE, 20,20)       ; start point
; it is better to draw line and after point
; to avoid to switch color at each drawing
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x0000ff)
GUICtrlSetGraphic(-1,$GUI_GR_DOT, 30,30)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 20,40)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000)
GUICtrlSetGraphic(-1,$GUI_GR_DOT, 25,25)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 40,40)
GUICtrlSetGraphic(-1,$GUI_GR_DOT, 30,40)

$a[6]=GuiCtrlCreateGraphic(110, 260, 230,130)
GUICtrlSetColor(-1,0)                       ; to display a balck border line
GUICtrlSetBkColor(-1,0xc0c0ff)
GUICtrlSetGraphic(-1,$GUI_GR_HINT, 3)       ; to display control lines and end points

GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0, 0xff); fill in blue
GUICtrlSetGraphic(-1,$GUI_GR_MOVE, 120,20)      ; start point
GUICtrlSetGraphic(-1,$GUI_GR_BEZIER, 120,100, 200,20, 200,100)
GUICtrlSetGraphic(-1,$GUI_GR_BEZIER+$GUI_GR_CLOSE, 100,40, 40,100, 40,20)
GUICtrlSetGraphic(-1,$GUI_GR_LINE, 60,30)       ; start point

GuiSetState()
EndFunc

I remember someone made a UDF for Graphs some years back. If I find it I will post it.

Or you could use the MS Logparser graph capabilities MS Logparser

regards

ptrex

Link to comment
Share on other sites

@all

From the old box.

#include "Guiconstants.au3"
;GUIS
;main window
$main = GUICreate("---Drawer---",400,320,850,600)
GUISetState()

;color sliders
$sliderr = GUICtrlCreateSlider (5,75,150,20)
GUICtrlSetLimit(-1,255,0)
GUICtrlSetData($sliderr,0)
$sliderg = GUICtrlCreateSlider (5,95,150,20)
GUICtrlSetLimit(-1,255,0)
GUICtrlSetData($sliderg,0)
$sliderb = GUICtrlCreateSlider (5,115,150,20)
GUICtrlSetLimit(-1,255,0)
GUICtrlSetData($sliderb,0)

$meter = "0x"&Hex(guictrlread($sliderr),2)&Hex(guictrlread($sliderg),2)&Hex(guictrlread($sliderb),2)
;color display
$label = GUICtrlCreateLabel("",10,10,50,50)
GUICtrlSetBkColor($label,$meter)

;color reading
GUICtrlCreateLabel("Red",155,115,25,15)
GUICtrlCreateLabel("Green",155,95,30,15)
GUICtrlCreateLabel("Blue",155,75,25,15)
$reading = GUICtrlCreateLabel($meter, 80,30,50,20)

;button
$butt = GUICtrlCreateButton("Draw", 200,10,190,50)
$exit = GUICtrlCreateButton("Exit", 200,70,190,50)

;lists
GUICtrlCreateLabel("X:", 10,175)
GUICtrlCreateLabel("Y:", 100,175)
$xlist = GUICtrlCreateList("", 25,150, 70, 90)
GUICtrlSetData($xlist, "Sin|Cos|Tan|Cot|Sec|Csc","Sin")
$ylist = GUICtrlCreateList("", 125,150, 70, 90)
GUICtrlSetData($ylist, "Sin|Cos|Tan|Cot|Sec|Csc","Cos")

;inputs why do i use edit???
GUICtrlCreateLabel("Dots:",200,152)
$edit1 = GUICtrlCreateInput("500",235,150,40,20,$ES_NUMBER)
GUICtrlCreateLabel("X Position:",200,175)
$edit2 = GUICtrlCreateInput("500",255,173,30,20,$ES_NUMBER)
GUICtrlCreateLabel("Y Position:",295,175)
$edit3 = GUICtrlCreateInput("500",350,173,30,20,$ES_NUMBER)
GUICtrlCreateLabel("X Radius:",200,199)
$edit4 = GUICtrlCreateInput("75",255,198,30,20,$ES_NUMBER)
GUICtrlCreateLabel("Y Radius:",295,199)
$edit5 = GUICtrlCreateInput("75",350,198,30,20,$ES_NUMBER)
GUICtrlCreateLabel("X Shape:",200,223)
$edit6 = GUICtrlCreateInput("0.1",255,223,30,20)
GUICtrlCreateLabel("Y Shape:",295,223)
$edit7 = GUICtrlCreateInput("0.1",350,223,30,20)

;change 1
$check = GUICtrlCreateCheckbox("",10,250,20,20)
GUICtrlCreateLabel("Change",30,250,50,20)
$combo = GUICtrlCreateCombo("",87,250,70,20)
GUICtrlSetData($combo,"X Position|Y Position|X Radius|Y Radius|X Shape|Y Shape","X Position")
GUICtrlCreateLabel("From", 160,250,50,20)
$inputfrom = GUICtrlCreateInput("100",190,250,30,20)
GUICtrlCreateLabel("To", 225,250,20,20)
$inputto = GUICtrlCreateInput("500",245,250,30,20)
GUICtrlCreateLabel("by", 282,250,20,20)
$inputby = GUICtrlCreateInput("100",300,250,30,20)
GUICtrlCreateLabel("at a time", 340,250,60,20)
;change 2
$check2 = GUICtrlCreateCheckbox("",10,280,20,20)
GUICtrlCreateLabel("Change",30,280,50,20)
$combo2 = GUICtrlCreateCombo("",87,280,70,20)
GUICtrlSetData($combo2,"X Position|Y Position|X Radius|Y Radius|X Shape|Y Shape","Y Position")
GUICtrlCreateLabel("From", 160,280,50,20)
$inputfrom2 = GUICtrlCreateInput("100",190,280,30,20)
GUICtrlCreateLabel("To", 225,280,20,20)
$inputto2 = GUICtrlCreateInput("500",245,280,30,20)
GUICtrlCreateLabel("by", 282,280,20,20)
$inputby2 = GUICtrlCreateInput("100",300,280,30,20)
GUICtrlCreateLabel("at a time", 340,280,60,20)
;GUIS


;DRAWER DLL CALLERS
$handle = ""
$DCdll = DllOpen("user32.dll")
$GDIdll = DllOpen("gdi32.dll")
$dc= DllCall ($DCdll, "int", "GetDC", "hwnd", $handle)
;DRAWER DLL CALLERS


$done = 0
While 1
    $msg = GUIGetMsg()
    
    $meter = "0x"&Hex(guictrlread($sliderr),2)&Hex(guictrlread($sliderg),2)&Hex(guictrlread($sliderb),2)
    GUICtrlSetBkColor($label,"0x"&Hex(guictrlread($sliderb),2)&Hex(guictrlread($sliderg),2)&Hex(guictrlread($sliderr),2))
    GUICtrlSetData($reading,$meter)
    sleep(35)
    
    If $msg = $GUI_EVENT_CLOSE Then
        Exit
    ElseIf $msg = $butt Then;draws
    ;increment part
        If GUICtrlRead($check) = $GUI_CHECKED Or GUICtrlRead($check2) = $GUI_CHECKED Then
            If GUICtrlRead($inputfrom) = "" Or GUICtrlRead($inputto) = "" Or GUICtrlRead($inputby) = "" And GUICtrlRead($check) = $GUI_CHECKED Then
                MsgBox(0,"Error","Must Enter Values")
                Exit
            EndIf
            If GUICtrlRead($inputfrom2) = "" Or GUICtrlRead($inputto2) = "" Or GUICtrlRead($inputby2) = "" And GUICtrlRead($check2) = $GUI_CHECKED Then
                MsgBox(0,"Error","Must Enter Values")
                Exit
            EndIf
            
        If GUICtrlRead($check) = $GUI_CHECKED Then
            $whattochange = Guictrlread($combo)
            If $whattochange = "X Position" Then
                $object = $edit2
            ElseIf $whattochange = "Y Position" Then
                $object = $edit3
            ElseIf $whattochange = "X Radius"Then
                $object = $edit4
            ElseIf $whattochange = "Y Radius" Then
                $object = $edit5
            ElseIf $whattochange = "X Shape" Then
                $object = $edit6
            ElseIf $whattochange = "Y Shape" Then
                $object = $edit7
            EndIf
            $from = GUICtrlRead($inputfrom)
            $to = GUICtrlRead($inputto)
            $step = guictrlread($inputby)
            If $from > $to Then
                $step = -$step
            EndIf    
            $count = ($from - $to)/$step
            $i = $from
        EndIf
        
        If GUICtrlRead($check2) = $GUI_CHECKED    Then
            $whattochange2 = GUICtrlRead($combo2)
            If $whattochange2 = "X Position" Then
                $object2 = $edit2
            ElseIf $whattochange2 = "Y Position" Then
                $object2 = $edit3
            ElseIf $whattochange2 = "X Radius"Then
                $object2 = $edit4
            ElseIf $whattochange2 = "Y Radius" Then
                $object2 = $edit5
            ElseIf $whattochange2 = "X Shape" Then
                $object2 = $edit6
            ElseIf $whattochange2 = "Y Shape" Then
                $object2 = $edit7
            EndIf
            $from2 = GUICtrlRead($inputfrom2)
            $to2 = GUICtrlRead($inputto2)
            $step2 = guictrlread($inputby2)
            If $from2 > $to2 Then
                $step2 = -$step2
            EndIf    
            $count2 = ($from2 - $to2)/$step2
            $j = $from2
        EndIf
        If GUICtrlRead($check) = $GUI_CHECKED And GUICtrlRead($check2) = $GUI_CHECKED Then            
            If $count <= $count2 Then
                $count = $count2
            EndIf
        EndIf
        
        If $count < 0 Then
            $count = -$count
        EndIf

            while $count >= 0
                draw($meter)                                                                        
                If GUICtrlRead($check) = $GUI_CHECKED Then
                    GUICtrlSetData($object,$i)
                    $i = $i + $step
                EndIf
            
                If GUICtrlRead($check2) = $GUI_CHECKED Then
                    GUICtrlSetData($object2,$j)
                    $j = $j + $step2
                EndIf
                
                $count = $count - 1
                    
            WEnd
            
        Else;increment part ends
            draw($meter)
        EndIf
        
    ElseIf $msg = $exit Then
        $realesedc= DllCall ($DCdll, "int", "ReleaseDC", "hwnd", 0,  "int", $dc[0])
        Exit
    EndIf
WEnd

Func draw($meter)
;DRAWER SETTING AREAS
    $color = $meter
    $x = 0
    $y = 0
    $loopcounter = 0
    $xaxi = GUICtrlRead($edit2)
    $yaxi = guictrlread($edit3)
    $revolution = GUICtrlRead($edit1)
    $xdiameter = GUICtrlRead($edit4)
    $ydiameter = GUICtrlRead($edit5)
    $xshape = GUICtrlRead($edit6)
    $yshape = guictrlread($edit7)

;read x list
    $xtemp = GUICtrlRead($xlist)
    If $xtemp = "Sin" Then
        $xtemp = 1
    ElseIf $xtemp = "Cos" Then
        $xtemp = 2
    ElseIf $xtemp = "Tan" Then
        $xtemp = 3
    ElseIf $xtemp = "Cot" Then
        $xtemp = 4
    ElseIf $xtemp = "Sec" Then
        $xtemp = 5
    ElseIf $xtemp = "Csc" Then
        $xtemp = 6
    ElseIf $xtemp = 0 Then
        MsgBox(0,"Error", "Must select a fuction for x")
        Return
    EndIf
;read y list
    $ytemp = GUICtrlRead($ylist)
    If $ytemp = "Sin" Then
        $ytemp = 1
    ElseIf $ytemp = "Cos" Then
        $ytemp = 2
    ElseIf $ytemp = "Tan" Then
        $ytemp = 3
    ElseIf $ytemp = "Cot" Then
        $ytemp = 4
    ElseIf $ytemp = "Sec" Then
        $ytemp = 5
    ElseIf $ytemp = "Csc" Then
        $ytemp = 6
    ElseIf $ytemp = 0 Then
        MsgBox(0,"Error", "Must select a fuction for y")
        Return
    EndIf
    While 1
        $xvalue = selectfunc($xtemp, $x)
        $yvalue = selectfunc($ytemp, $y)
        $setpixel= DllCall ($GDIdll, "long", "SetPixel", "long", $dc[0], "long", $xdiameter*$xvalue+$xaxi, "long", $ydiameter*$yvalue+$yaxi, "long", $color)
;~                 MouseMove($xdiameter*$xvalue+$xaxi,$ydiameter*$yvalue+$yaxi,2)
        $x = $x + $xshape
        $y = $y + $yshape
;~         ToolTip($x&","&$y,1000,900)
;~         ToolTip($loopcounter,1000,900)
        If $loopcounter > $revolution Then
            ExitLoop
        EndIf
        $loopcounter = $loopcounter + 1
    WEnd
    
EndFunc

Func selectfunc($choice,$value)
    If $choice = 1 Then
        Return Sin($value)
    ElseIf $choice = 2 Then
        Return Cos($value)
    ElseIf $choice = 3 Then
        Return Tan($value)
    ElseIf $choice = 4 Then
        Return 1/Tan($value)
    ElseIf $choice = 5 Then
        Return 1/Cos($value)
    ElseIf $choice = 6 Then
        Return 1/Sin($value)
    EndIf
EndFunc

regards

ptrex

Link to comment
Share on other sites

@all

An other way of doing graphs is this way

$objExcel = ObjCreate("Excel.Application")
$objExcel.Visible = True

$objWorkbook = $objExcel.Workbooks.Add()
$objWorksheet = $objWorkbook.Worksheets(1)

$objWorksheet.Cells(1,1) = "Operating System"
$objWorksheet.Cells(2,1) = "Windows Server 2003"
$objWorksheet.Cells(3,1) = "Windows XP"
$objWorksheet.Cells(4,1) = "Windows 2000"
$objWorksheet.Cells(5,1) = "Windows NT 4.0"
$objWorksheet.Cells(6,1) = "Other"

$objWorksheet.Cells(1,2) = "Number of Computers"
$objWorksheet.Cells(2,2) = 145
$objWorksheet.Cells(3,2) = 987
$objWorksheet.Cells(4,2) = 611
$objWorksheet.Cells(5,2) = 41
$objWorksheet.Cells(6,2) = 56

$objRange = $objWorksheet.UsedRange
$objRange.Select

$colCharts = $objExcel.Charts
$colCharts.Add()

$objChart = $colCharts(1)
$objChart.Activate

$objChart.Export ("C:\MyGraphTest.jpg", "JPG")

Exported as JPG.

Enjoy !!

ptrex

Link to comment
Share on other sites

@all

An other way of doing graphs is this way

$objExcel = ObjCreate("Excel.Application")
$objExcel.Visible = True

;;Snipped

Exported as JPG.

Enjoy !!

ptrex

Will this work with

$objExcel.Visible = False

To the hide Excel window?

What I want to do is to be able to create and save a chart as an image and then place it on a GUI with GUICtrlSetImage()

I've been looking at the possibility of just using the chart.dll file but I've done nothing with it so far.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Link to comment
Share on other sites

I remember someone made a UDF for Graphs some years back. If I find it I will post it.

ptrex

Looking forwared to that.

@anybody they have the sourcecode up, does anyone know how to convert to autoit?

http://bitworking.org/projects/sparklines/spark.py

Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Link to comment
Share on other sites

@GEOSoft

As you might have tried already, this works like a charm.

The graph is saved in JPG, and you don' t see a thing appearing.

regards,

ptrex

Haven't had a chance to try it yet but thanks for the reply and it's just the right answer for me because I know that I can set the chart type with it. That way I'll be able to display Bar, Pie &etc.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Thanks everyone.

The excel chart would be nice but it's not always on every computer.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Thanks everyone.

The excel chart would be nice but it's not always on every computer.

Thats the bad part. If I can do it with just chart.dll then I might be inclined to break the redist rule for that file. Well, maybe not.

There are probably other dlls available that would do, I just need more research.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...