AutoHotkey Community

It is currently May 25th, 2012, 6:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: August 28th, 2007, 7:26 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Icarus wrote:
btw - in this case, does the XA-4 eqyal to &ArrayX?

Yes.

OTOH, I see you use the relative path ..\Res\DLLs\rmchart.dll all over the place.
It could cause a problem, so, don't specify the path at all except in LoadLibrary.
After LoadLibrary, use only the name of the dll like rmchart.dll.
Except that, the syntax of the dllcall() seems to be correct to me, but I can't be 100% sure unless I tests it myself. Unfortunately I don't use rmchart.dll myself. I hope other members using it could clarify it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 28th, 2007, 7:40 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
Thanks, didnt know I can omit the path.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 17th, 2009, 11:02 pm 
I am wondering if rmchart.dll is also supporting an x-axis column using an HH:mm time format? e.g. Excel is supporting that kind of values correctly on the x-axis. Any ideas?

Here is one example, test.csv:
Code:
14:34,154
14:40,158
16:52,195


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2009, 1:08 pm 
Offline

Joined: January 13th, 2009, 8:15 am
Posts: 25
lingoist wrote:
I've written some functions to better manipulate data in RMChart. I recommend that you read documentation file of RMChart DLL http://www.rmchart.com/.

Here are the functions (version 1.0):
Code:
   ;AHK_RMC_SetSeriesData(nCtrlId, nRegion, 1, "20070612", nDataValuesCount)



This line is the only one that doesn't work and it's the one I want to learn how to use in AHK ;D

What I want to do is to update the next value in the series with the value from a variable.

Like, if I press a button a variable gets a random value which is charted in Series 1...

Anyone know how I would go about doing this?
The Documentation states that you should use an array like Array(0) but there are no such arrays in AHK... :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2009, 2:01 pm 
Offline

Joined: January 13th, 2009, 8:15 am
Posts: 25
Code:
#SingleInstance Force

Gui +LastFound
GuiID  := WinExist()
Noob:
AddChart( GuiID, "MyBars.rmc" )
Gui Show, w700 h500, Chart Test

f8::
Goto, Redraw
Return

GuiClose:
GuiEscape:
   ExitApp
Pause::Reload
Return

Redraw:
RedrawChart()
Return
 
AddChart( GuiID, DesignFile ) {
   ; Load RMChart DLL
   ChartModule := DllCall("LoadLibrary", "str", "rmchart.dll")
   
   ; Build the chart based on the RMC file
   result := DllCall("rmchart.dll\RMC_CREATECHARTFROMFILE" 
         ,UInt,GuiID
         ,UInt,1000         ; ctrl id of the chart window
         ,UInt,0             ; x
         ,UInt,0             ; y
         ,UInt,0             ; display only
         ,Str,DesignFile )    ; RMCFile
         
   ; Draw the chart
   result := DllCall("rmchart.dll\RMC_DRAW"
         ,UInt,1000 )   ; CtrlId
}

RedrawChart() { ;;This function doesn't change anything visually
   ChartModule := DllCall("LoadLibrary", "str", "rmchart.dll")
   result := DllCall("rmchart.dll\RMC_DRAW"
         ,UInt,1000 )   ; CtrlId
}


I want to redraw the chart when I press F8...

If I call AddChart() when pressing F8 the chart is recreated and then drawn... I just want it to be redrawn without having to recreate the chart....

Help :shock:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 20th, 2009, 4:10 pm 
When I select XY-scatter chart in rmcdesigner.exe and select select for the data "from file" it is crashing. So could anybody manage to design simple x against y curves from a simple data.csv with two columns, where the first columns has the x values and the second column the y values?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2009, 11:00 pm 
Offline

Joined: May 2nd, 2006, 11:16 pm
Posts: 800
Location: Greeley, CO
The RMChart website has been dead for a couple months, so I assume it won't be coming back;
I have the files for RMChart available here and I'm pretty sure SKAN still has them available here.

_________________
Image
SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2009, 5:36 am 
Offline

Joined: July 7th, 2008, 7:29 pm
Posts: 27
Heres a quick example of how to call RMC_SETSERIESDATA. For more info on it check out the "Structures and Arrays" section of DllCall() in the AHK help file. I think that would also solve your problem Icarus.

Code:
;first initialize your chart as the other examples demonstrate

NUMPOINTS := 60 ;replace 60 with the number of points you want
numBits := NUMPOINTS * 8
varSetCapacity(valArr, numBits, 0) ;valArr is an array that will store your series
   
GuiControlGet, expression,, expression ;this line doesn't really apply to
                                         ;anyone else. It just initializes "expression"

i = 0
loop, %NUMPOINTS% {
   input := 127 / (NUMPOINTS - 1) * i ;replace these two lines with a
   val := map(expression, input)   ;function that sets val to your ith point.
   NumPut(val, valArr, i * 8, "double") ;inserts val into the ith element of valArr
   i++
}

result := DLLCall("rmchart.dll\RMC_SETSERIESDATA"
                , "UInt", 1001
                , "UInt", 1
                , "UInt", 1
                , "UInt" , &valArr
                , "UInt", NUMPOINTS
                , "UInt", 0     )
   
DLLCall("rmchart.dll\RMC_DRAW"
                , "UInt", 1001     )


sorry its kinda messy but hopefully this helps.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 11th, 2009, 2:58 am 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 357
Location: north bay, california
hey, thanks for the great info everyone

RMC_Draw2File() - save your chart to an image

i havent seen any mention of this, but i'm finding it useful for outputting the chart resulting chart onto a pdf (using libHaru), or could save a history of charts, use for webpages, etc... i'm surprised no one wanted this

requires gdi+, which may already be needed

From RMChart documentation:
Quote:
RMC_Draw2File function.
Draws a chart into a *.jpg, *.png or *.emf file
--------------------------------------------------------------------------------
Syntax
nResult (LONG) = RMC_Draw2File(
ByVal nCtrlId (LONG),
ByRef sFileName (ASCIIZ),
Optional ByVal nWidth (LONG),
Optional ByVal nHeight (LONG),
Optional ByVal nJPGQualityLevel (LONG)
)


my quick and dirty function:
Code:
#singleinstance force
hModule := DllCall("LoadLibrary", "str", "rmchart.dll")

Gui +LastFound

file = %A_ScriptDir%\bars.png
;msgbox, % file
hGui  := WinExist()

result := DllCall("rmchart.dll\RMC_CREATECHARTFROMFILE"
                 , "UInt", hGui   ; Parent
                 , "UInt", 1001   ; CtrlId
                 , "UInt", 5      ; X
                 , "UInt", 5      ; Y
                 , "UInt", 0      ; ExportOnly
                 , "Str", "bars.rmc"     ) ; RMCFile

result := DllCall("rmchart.dll\RMC_DRAW"
                 , "UInt", 1001)   ; CtrlId

result := DllCall("rmchart.dll\RMC_DRAW2FILE"
                 , "UInt", 1001   ; CtrlId
                 , "Str", file ;)  ; pictureFile
                 , "UInt", 0      ; X
                 , "UInt", 0      ; Y
                 , "UInt", 0   )   ; quality


Gui, Show, w700 h500, RM Chart




Return

GuiClose:
GuiEscape:
 ExitApp
Return



hope someone finds it useful
- gwarble


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], kiropes, lblb, nothing and 38 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group