Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Change Font Size of Dimension Axis Label by Macro

Dear All,

I've created a bar chart and need to change the font size of label at Dimension Axis. I've found a way to do it thourgh Properties -> Axes ->Dimension Axis -> Font, but does anyone know how to change its size arbitrary, preferably by macro function? I couldn't find any tips even in the API guide.

Many Thanks in Advance.

1 Solution

Accepted Solutions
jsn
Master
Master

Ok, found it by searching for one of the other features of the Dim axis.

sub chartfont
set chart = ActiveDocument.Sheets("Sheetname").CreateLineChart
chart.AddDimension "Product"
chart.AddExpression "sum(Sales)"
set p = chart.GetProperties
p.ChartProperties.XAxis.Font.PointSize1000 = 30000
chart.SetProperties p
end sub


View solution in original post

8 Replies
jsn
Master
Master

Hi OGA,

The member is trickily named PointSize1000 and works like this:

sub DimFontSize
set chart = ActiveDocument.Sheets("SheetName").CreateLineChart
chart.AddDimension "Product"
chart.AddExpression "sum(Sales)"
set p = chart.GetProperties
p.Expressions.Item(0).Item(0).Data.AxisData.Font.PointSize1000 = 30000
chart.SetProperties p
end sub


Not applicable

Hi, Johannes

Thanks for the reply. I've alredy found and tried this code, but this changes the font size of Expressions Axes labels. (it's generally called Y-Axis Label, maybe) But I need to change the one of Dimension Axis (called X-Axis, maybe).

Thanks for your help, though.

jsn
Master
Master

Ah, sorry, was a bit quick on the old keyboard.

Right, dimension.. that was trickier. Can't find anything in the API guide either. Can only find font settings for Expression axes, Legend, Text objects and Title.

Not applicable

Right. I've tried all of them...but didn't work for Dimension Axis.

Since I can change its font thourhg properties, I'm assuming there's got to be a way to change it by macro function...

jsn
Master
Master

Ok, found it by searching for one of the other features of the Dim axis.

sub chartfont
set chart = ActiveDocument.Sheets("Sheetname").CreateLineChart
chart.AddDimension "Product"
chart.AddExpression "sum(Sales)"
set p = chart.GetProperties
p.ChartProperties.XAxis.Font.PointSize1000 = 30000
chart.SetProperties p
end sub


View solution in original post

Not applicable

It worked!!!!!! I really appreciate your help!!!!

but how did you find it??

jsn
Master
Master

Took a little detective work. Pulled up the chart properties and the Axes tab. Looked for one of the features that only exist for the Dimension Axis, Backcast. Found it in the API guide and found the Font under the IAxisDef class as well.

Not applicable

I got it. That was a little tricky. I've always searching in API guide from "Font" key word.

Anyway, it was such a great help!! Thanks for your kindness!!

Many thanks, again.