ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How to get the xlabel value from a COM based object.
Posted by Javier on Oct-10-2012 00:00
Attachments:
Hi:

        I am testing CD 5.1  (using ABL from Progress software) and i need to get the xLabel value from a graph bar when i click to that bar and assign this to a variable.

Right now i can display the xLabel and the Value in the screen (Usin ChartViewer),   When i click in a bar,   the event triggers this procedure and  I can get the values ​​of the variables shown. . even the imagemap as text.

DEFINE INPUT-OUTPUT PARAMETER p-hotSpot AS COM-HANDLE NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER p-Button   AS INTEGER    NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER p-Shift      AS INTEGER    NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER p-X          AS DECIMAL    NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER p-Y          AS DECIMAL    NO-UNDO.

MESSAGE chGrafica:chartviewer:ImageMap().
MESSAGE "p-hotSpot " + STRING(p-hotSpot) + ", p-Button " + STRING(p-Button) + " p-Shift " + STRING(p-Shift) + " p-X " + STRING(p-X) + " p-Y " + STRING(p-Y).

END PROCEDURE.

Is there any way to get the xLabel Value?

Thanks.
Image.png

  Re: How to get the xlabel value from a COM based object.
Posted by Peter Kwan on Oct-10-2012 02:34
Hi Javier,

The xLabel and value can be retrieved from the hotSpot Collection using "xLabel" and "value" as keys.

I am not familiar with ABL. In VB, the syntax would be like:

myLabel = hotSpot.Item("xLabel")
myValue = hotSpot.Item("value")

or you may use the simplified form:

myLabel = hotSpot("xLabel")
myValue = hotSpot("value")

Hope this can help.

Regards
Peter Kwan

  Re: How to get the xlabel value from a COM based object.
Posted by Javier on Oct-10-2012 03:22
Thanks Peter:

It works !,    I was two days looking for the answer.  It would be nice to include this in the user guide.

regards from Mexico.

  Re: How to get the xlabel value from a COM based object.
Posted by Peter Kwan on Oct-11-2012 01:22
Hi Javier,

The documentation is at:

http://www.advsofteng.com/doc/cdcom.htm#ChartViewer.ClickHotSpot.htm

I realize the above documentation mentions that the hotSpot parameter is a "VB Collection", without elaborating what is a "VB Collection". This may be difficult to understand for developers usng other programming langauges. We will include clarification of what is a VB Collection in future editions of the documentation.

And then I must thank you very much for confirming that it works.

Regards
Peter Kwan

  Re: How to get the xlabel value from a COM based object.
Posted by Javier on Oct-11-2012 07:54
Hi Peter.


         Although i remember that a "VB Collection" is equivalent to a Record,  The programming lenguaje i use does not accept the intruccion:

variable = hotspot("value")

   Because this,  i  was testing and looking for a property to get the value, the one i do not found.

The programming lenguaje i use accept only the property "item" wich you told me and is not documented.

variable = hotspot:item("value").

I am going to continue  testing the product and i tell you about the results.


Thanks


p.d. progress is a good DBMS , but does not have tools for graphs or reports.
http://www.progress.com