Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get chart coordinates via VBScript

Hi to all,

in these days I'm facing to this problem.

I have a scatter chart with two expressions as coordinates.

What I want to do is to get the values of the coordinates on the chart showed in the bottom left corner of QlikView screen.

In the attached image you can see the information I need.

Is there a VBSript function or something like that, that can give me back this information, please?

Thanks in advance for your help.

Best regards,

Mario Masciulli

6 Replies
Not applicable
Author

Something like this (don't forget to change your chart ID)? Perhaps store values in variables then put them in a text box positioned on the graph with layer = top?

sub getCoords

set doc=ActiveDocument

set chart = ActiveDocument.GetSheetObject("CH33")

chartX = chart.GetProperties.GraphLayout.Frame.Rect.Left

chartY =  chart.GetProperties.GraphLayout.Frame.Rect.Top

msgbox("x=" & chartX & ",y=" & chartY)

end sub


Regards,

Gordon

Not applicable
Author

Hi Gordon,

thanks for your answer but what I was looking for is the couple of values related to the movement of my mouse.

I mean, if I move on my scatter chart I see in the bottom left corner of QlikView two values changing, representing each one, one of the axis (x and y).

In the file attached, for example, the value I'm looking for is: 241.39899....

Do you know any way to get these values?

Thanks again.

Regards,

Mario

Not applicable
Author

Hi to all,

does anyone have some suggestion to my question please?

I'm still facing the same problem and actually I'm not able to get the two values I see in the bottom left corner when I move on my scatter chart.

Any help is appreciated.

Thanks, regards,

Mario Masciulli

Not applicable
Author

Up!!

Anonymous
Not applicable
Author

Gordon - i believe the issue is that coordinates that are stored in Rect are not the same as those displayed by QV - in my case,  373,297 are represented as 1167,926 - i.e. everything is multiplied by 3.12.

Any idea where does this translation come from?

Anonymous
Not applicable
Author

Mario - if your issue is the same as mine - i.e. different coordinate system between values shown in the UI and from Frame.Rect - then the solution is using object.GetRect directly, without going via Frame - then the values are correct.