X trace enable in Vision Chart using script

Hi,

i am using XY chart. I want to enable x trace without right click and choosing

Is there any option to do it

If you had asked about a Chart or Easy Chart in Vision, I would have directed you to this post.

...but the XY chart is a Perspective thing, and I didn't even know that right click-->xtrace was an option for that.

XY chart in vision - yes i also tired couldn't find any solution

Am I missing something? These are the only chart options in my Vision component pallet:
image

I'm sure I can figure this out; I just need to know which component to work with.

2 second one Chart

1 Like

To have it automatically be in xtrace when the page loads or when the page is opened in the designer while in preview mode, use this script on the chart's propertyChange event handler:

if event.propertyName == 'componentRunning':
	chartComponent = event.source
	xTrace = chartComponent.getClass().getSuperclass().getDeclaredField("xtraceItem")
	xTrace.setAccessible(True)
	xTrace.get(chartComponent).setSelected(True)

To do this from a button somewhere on the page, use the button's actionPerformed event handler with this script:

chartComponent = event.source.parent.getComponent('chart')#path to chart component relative to the button
xTrace = chartComponent.getClass().getSuperclass().getDeclaredField("xtraceItem")
xTrace.setAccessible(True)
xTrace.get(chartComponent).setSelected(True)
3 Likes