Jump to content
Software FX Community

How to get multi-line axis labels ?

User (Legacy)

Recommended Posts

I am trying to create two-line labels for a data/time combination. I

approach this by providing a routine for the GetAxisLabel Event and putting

the string together with a vbCrLf, as follows:

Private Sub ChartFX_GetAxisLabel(index As Integer, ByVal nAxis As Integer,

nRes As Integer)

If nAxis = AXIS_X Then

Dim x() As String

x = Split(ChartFX(index).HText, ";")

ChartFX(index).HText = x(1) + vbCrLf + x(0)

nRes = 1

End If

I create a starting string by specifying the axis format property as "Xd MMM

yy;HH:mm tt"

The result is not what I am looking for, some null characters show up in the

text, which is still a single line.

I would like to get something like

11:33 PM

2 Oct 01

possibly centered below the tick mark. Any chances?

Henk Borsje


Link to comment
Share on other sites

You can add CR+LF to the labels itself there in no need of capturing the

GetAxisLabel event you must however, set the Axis style to

ChartFX1.Axis(AXIS_X).Style = Chart1.Axis(AXIS_X).Style and Not


For example:

ChartFX1.Axis(AXIS_X).Style = ChartFX1.Axis(AXIS_X).Style And Not


ChartFX1.Legend(0) = "Line 1" + vbCrLf + "Line 2"

CR + LF can also be used in the GetAxisLabel event, but still the style of

the axis must have the AS_SINGLELINE flag OFF.



Software FX, Inc.

Link to comment
Share on other sites

  • 10 years later...


We are using ChartFX Client Server 5.1 (Version: together with Active Reports.

Until now I was convinced that it is not possible to have multiline Axis-Labels, but now I found this post.

Unfortunately it doesn't work in my Report:

chart1.Axis(AXIS_X).Style = chart1.Axis(AXIS_X).Style

and not AS_SINGLELINEchart1.Axis(AXIS_X).Label(iRow) = DATEPART("m",DateVorjahr) & vbcrlf & RIGHT(DATEPART("yyyy",DateVorjahr),2)

 the linefeed is ignored and the two strings are glued together.

I look forward to your answer!


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...