Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show caption Text with Macro

Hi All,

I am creating a Chart by Macro. In that i have to set the caption Name but not able to set.

I have pasted all the code below. Please have a look and if someone have the solution, pls share.

Thanks in advanced.

Sub FunctionBarChart

  set myBarChart=ActiveDocument.ActiveSheet.CreateBarChart

  'Getting values from Variable for chart Expression and Dimension

  GetBarDimName = ActiveDocument.Variables("vDim").GetContent.String

  myBarChart.AddDimension GetBarDimName 

  GetBarMeasureName = ActiveDocument.Variables("vMeasure").GetContent.String

       if GetBarMeasureName = "Minutes" then

            myBarChart.AddExpression "Sum(Minutes)"

                 else if GetBarMeasureName = "Hours" then

                      myBarChart.AddExpression "Sum(Minutes)/60"

                           else if GetBarMeasureName = "WeekOf" then

                           myBarChart.AddExpression "Count("&GetBarMeasureName&")"

                           end if

                 end if

       end if

set bcp = myBarChart.GetProperties

bcp.SetCaption.Name = "My Cap"

myBarChart.SetProperties bcp

end sub

1 Solution

Accepted Solutions
marcus_sommer

Use this for title and caption:

bcp.ChartProperties.Title.Title.v = "My text"

bcp.GraphLayout.WindowTitle.v = "Xyz"

- Marcus

View solution in original post

3 Replies
marcus_sommer

Use this for title and caption:

bcp.ChartProperties.Title.Title.v = "My text"

bcp.GraphLayout.WindowTitle.v = "Xyz"

- Marcus

Not applicable
Author

Thanks Marcus.

Its working !!!!

Do you have any idea, how can i enable the Menu option in Caption with Macro.

marcus_sommer

Try this:

bcp.Layout.Frame.MenuIcon=true

- Marcus