 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Tue Aug 28, 2007 6:26 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 851
|
Posted: Tue Aug 28, 2007 6:40 am Post subject: |
|
|
| Thanks, didnt know I can omit the path. |
|
| Back to top |
|
 |
unlogged_automaticman Guest
|
Posted: Tue Feb 17, 2009 10:02 pm Post subject: rmchart.dll and HH:mm support on the x-axis |
|
|
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 |
|
|
| Back to top |
|
 |
alarian
Joined: 13 Jan 2009 Posts: 25
|
Posted: Fri Feb 20, 2009 12:08 pm Post subject: |
|
|
| 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...  |
|
| Back to top |
|
 |
alarian
Joined: 13 Jan 2009 Posts: 25
|
Posted: Fri Feb 20, 2009 1:01 pm Post subject: |
|
|
| 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  |
|
| Back to top |
|
 |
unlogged_automaticman Guest
|
Posted: Fri Feb 20, 2009 3:10 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
SoggyDog
Joined: 02 May 2006 Posts: 783 Location: Greeley, CO
|
|
| Back to top |
|
 |
robcheese
Joined: 07 Jul 2008 Posts: 27
|
Posted: Fri May 22, 2009 4:36 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
gwarble
Joined: 23 May 2009 Posts: 235 Location: north bay, california
|
Posted: Tue Aug 11, 2009 1:58 am Post subject: RMC_Draw2File pngs and jpgs |
|
|
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 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|