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

hjborsje@alert-systems.com

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

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.

Link to comment
Share on other sites

  • 10 years later...

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...