Jump to content
Software FX Community
User (Legacy)

How to get multi-line axis labels ?

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

hjborsje@alert-systems.com

Share this post


Link to post
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

AS_SINGLELINE

For example:

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

AS_SINGLELINE

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.

--

FP

Software FX, Inc.

Share this post


Link to post
Share on other sites

Hi

We are using ChartFX Client Server 5.1 (Version: 5.0.10.3) 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!

Regards,Luzia

Share this post


Link to post
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.

Guest
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.

Loading...

×
×
  • Create New...