Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting Scroll Bar to default to the right

In the attached chart I am trying to figure out how to set the scrollbar to default to the right.

How do you enable or insert a macro such as:

sub OneOff

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

end sub

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

spb wrote:

Can you attach an example.  I tried to follow and it move the scroll bar to the left.

View solution in original post

11 Replies
johnw
Champion III
Champion III

Settings -> Document Properties -> Triggers -> Document Event Triggers -> OnOpen -> Add Action(s)... -> Add -> External -> Run Macro -> OK -> Macro Name = OneOff -> OK -> OK -> Save -> Close -> Reopen the document

Not applicable
Author

John,

Can you attach an example.  I tried to follow and it move the scroll bar to the left.

johnw
Champion III
Champion III

spb wrote:

Can you attach an example.  I tried to follow and it move the scroll bar to the left.

Not applicable
Author

Thank you John.

gyan_srivastava
Contributor III
Contributor III

Hi John,

It works fine with bar charts and other charts .But If I select Pivot table pie chart then it will not work...Can you please suggest something for Pivot table.

I have just converted your attachement graph to pivot table for example.

thanks in advance .

Gyan

Not applicable
Author

really helpful..

but how to apply to all chart?

many thx,i never do macro before

Not applicable
Author

Rendi: You need to identify all the chart objects in the macro.  Example below IDs three separate charts:

sub ScrollRt

set chart1 = ActiveDocument.GetSheetObject("CH03")

set chart2 = ActiveDocument.GetSheetObject("CH07")

set chart3 = ActiveDocument.GetSheetObject("CH09")

set p1 = chart1.GetProperties

set p2 = chart2.GetProperties

set p3 = chart3.GetProperties

p1.ChartProperties.XScrollInitRight = true

p2.ChartProperties.XScrollInitRight = true

p3.ChartProperties.XScrollInitRight = true

chart1.SetProperties p1

chart2.SetProperties p2

chart3.SetProperties p3

end sub

sujeetsingh
Master III
Master III

John will it work for the Pivot table

oliverhughes
Contributor
Contributor

Hi,

I have been searching for a way to run a macro for setting specified chart object scrollbars to the far-right, by default. I found a VB solution for this yesterday, as below:

sub ScrollRight

set chart1 = ActiveDocument.GetSheetObject("1234")

set p1 = chart1.GetProperties

p1.ChartProperties.XScrollInitRight = true

chart1.SetProperties p1

end sub

This worked fine for this app and works great.

However, I am now working on another of my apps and want to do the same thing again, but I already have a jscript macro within the app. I am wondering; would there be a way to convert the VB script (above) to jscript, so I can also use it in this other app? I have to keep the existing jscript  macro, so getting rid of that and switching to VB is not an option.

I am confused as to why QlikView doesn't allow you to have separate macros, rather than the single script layout that's there is. That way it would  be possible to have different macros running different languages.

Any help much appreciated.

  1. Thanks.