Jump to content
Software FX Community

y axis Align with labels, how to?


User (Legacy)

Recommended Posts

I can manually set the y axis grid lines to the option of "Align with

labels" while running the application.

Align with labels ensures that labels are displayed centered and aligned

with tickmarks at the major interval in the selected axis.

How can i set the "Align with labels" option through code? I have tried

lots of different code but am stumped. Any advice?

With AnyChart

With .Axis(AXIS_Y)

'Alignwithlabels = true

'NOT SURE HOW TO DO IT

End With

End With

Thanks in advance,

Dan Hickman

Link to comment
Share on other sites

Hello,

You can accomplish this task by setting the style property of the axis

object.

ChartFX1.Axis(AXIS_Y).Style = ChartFX1.Axis(AXIS_Y).Style Or AS_CENTERED

Justin Trask

Tech. Support

561-392-2023

"Dan Hickman" <danh@promodel.com> wrote in message

news:#g#K4SjQCHA.1060@webserver1.softwarefx.com...

> I can manually set the y axis grid lines to the option of "Align with

> labels" while running the application.

>

> Align with labels ensures that labels are displayed centered and aligned

> with tickmarks at the major interval in the selected axis.

>

> How can i set the "Align with labels" option through code? I have tried

> lots of different code but am stumped. Any advice?

>

>

> With AnyChart

> With .Axis(AXIS_Y)

> 'Alignwithlabels = true

> 'NOT SURE HOW TO DO IT

> End With

> End With

>

>

> Thanks in advance,

> Dan Hickman

>

>

Link to comment
Share on other sites

  • 7 months later...

I am using a Gantt chart (see the chart initialization code below), and your

suggestion does not work.

I still have to manually go in and set the Y-Axis labels to "Align with

labels".

What am I doing wrong ?

With ChartFX1

' Start from original chart

'.Import CHART_CFXOLEFILE, "original.chd"

.Gallery = GANTT

.RGB2DBk = RGB(255, 255, 255)

.RGBBk = RGB(255, 255, 255)

.AxesStyle = CAS_FLATFRAME

' Y-Axis format

With .Axis(AXIS_Y)

.Grid = True

.GridColor = RGB(192, 192, 192)

.ResetScale

.Format = "dd-MMM-yy"

.Style = (.Style Or AS_CENTERED Or AS_INTERLACED) And Not AS_SHOWENDS

.LabelAngle = 90

.ResetScale

.STEP = 30 ' Monthly

End With

'...

End With

Thanks in advance...

"SFX Tech Support" <support@softwarefx.com> wrote in message

news:SkQGC77QCHA.2120@webserver1.softwarefx.com...

> Hello,

>

> You can accomplish this task by setting the style property of the axis

> object.

>

> ChartFX1.Axis(AXIS_Y).Style = ChartFX1.Axis(AXIS_Y).Style Or AS_CENTERED

>

> Justin Trask

> Tech. Support

> 561-392-2023

>

> "Dan Hickman" <danh@promodel.com> wrote in message

> news:#g#K4SjQCHA.1060@webserver1.softwarefx.com...

> > I can manually set the y axis grid lines to the option of "Align with

> > labels" while running the application.

> >

> > Align with labels ensures that labels are displayed centered and aligned

> > with tickmarks at the major interval in the selected axis.

> >

> > How can i set the "Align with labels" option through code? I have tried

> > lots of different code but am stumped. Any advice?

> >

> >

> > With AnyChart

> > With .Axis(AXIS_Y)

> > 'Alignwithlabels = true

> > 'NOT SURE HOW TO DO IT

> > End With

> > End With

> >

> >

> > Thanks in advance,

> > Dan Hickman

> >

> >

>

>

Link to comment
Share on other sites

"Align With Labels" is the Default. AS_CENTERED is the opposite to this. In

a default chart AS_CENTERED is OFF and therefore "Align With Labels" option

is checked.

Either you turned this OFF at design time or somewhere in your code. You can

test this very easily, simply drop a brand new char in a form, run the

application and got to the Y-Axis property pages. You should see the "Align

With Labels" checked.

To turn it OFF after it is turned ON you need to do:

ChartFX1.Axis(AXIS_Y).Style = ChartFX1.Axis(AXIS_Y).Style and not

AS_CENTERED

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...