Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Is there an easy way to set the scrolled position for a line graph?

Is there an easy way to set the scrolled position for a line graph?

On the Presentation tab in the user interface, Max Visible is set to 15 and Show X-Axis Scrollbar is checked. 

Can I dynamically when a user opens the .qvw presentation have the scrolling position automatically be set to the right most position representing the most current data?

1 Solution

Accepted Solutions
MVP
MVP

Is there an easy way to set the scrolled position for a line graph?

Looks fine.

8 Replies
MVP
MVP

Re: Is there an easy way to set the scrolled position for a line graph?

Yes, but the way I know to do it involves a little macro code.  Set an OnOpen trigger to execute a macro.  In the macro, execute code like this.  Substitute your own chart ID, of course.

set chart           = ActiveDocument.GetSheetObject("CH23")
set chartProperties = chart.GetProperties
chartProperties.ChartProperties.XScrollInitRight = true
chart.SetProperties chartProperties

Not applicable

Re: Is there an easy way to set the scrolled position for a line graph?

Thanks…… Sweet, great intro….. works great, updated multiple objects and is fine.

Will this simple macro be ok if this is placed on a server and gets updates from there? Will users who then access this and open the document from the server get the macro update?

MVP
MVP

Is there an easy way to set the scrolled position for a line graph?

As I recall, and unless this has changed in more recent versions, the OnOpen trigger is not guaranteed to work in a server environment.  That said, I have never seen my OnOpen triggers fail in a server environment.  Also, it's possible that the XScrollInitRight is a permanent property stored when you save, like a checkbox that just somehow didn't make it into the point and click object properties, but is still really there.  If so, executing the macro once, saving, and then removing the macro never to execute again would still work.  I've not tested that, though.

Not applicable

Re: Is there an easy way to set the scrolled position for a line graph?

John,

Great.

Does this script look ok?

set chart = ActiveDocument.GetSheetObject("CH24")

set chartProperties = chart.GetProperties

true

set chart2 = ActiveDocument.GetSheetObject("CH56")

set chartProperties2 = chart2.GetProperties

true

I started to get a Inconsistency Type B and D a couple times in the last couple hours. One thing I changed in the last 24 hours was to use this trigger. Wondering did I mess it up somehow that I am not seeing? The script seems to correctly update.

Thanks,

DD

MVP
MVP

Re: Is there an easy way to set the scrolled position for a line graph?

That script seems to be missing a bunch of stuff on your "true" lines.

Since posting yesterday I verified that once the macro has executed, the property remains.  You should be able to remove the trigger.  I did so successfully in a sample application.  So just in case the trigger has anything to do with the internal inconsistency error, you can try removing it, and even the macro if you want.

Not applicable

Re: Is there an easy way to set the scrolled position for a line graph?

John,

Sorry, here is text paste:

set chart = ActiveDocument.GetSheetObject("CH24")

set chartProperties = chart.GetProperties

chartProperties.ChartProperties.XScrollInitRight = true

chart.SetProperties chartProperties

set chart2 = ActiveDocument.GetSheetObject("CH56")

set chartProperties2 = chart2.GetProperties

chartProperties2.ChartProperties.XScrollInitRight = true

chart2.SetProperties chartProperties2

DD

MVP
MVP

Is there an easy way to set the scrolled position for a line graph?

Looks fine.

jonathjl
New Contributor II

Re: Is there an easy way to set the scrolled position for a line graph?

do you have an example qvw of this?

Community Browser