Marks increases Axis Maximum

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ArcUsers
Newbie
Newbie
Posts: 8
Joined: Mon Jan 16, 2006 12:00 am

Marks increases Axis Maximum

Post by ArcUsers » Wed Feb 01, 2012 2:42 pm

Hey!

I got a quick question.

I have a Custom Axis that goes from 0 to 100. I added a series to my graph that uses this axis and this serie has a Bar Style.

If I make the Marks visibles, the axis gets a redefined Maximum to make the Marks fit inside the axis.

However, this is the not behavior that I want, I would like the Marks to paint outside the range the axis if it has to!

Currently this is my Series setup:

Code: Select all

 Dim loNewSerie As Styles.Bar = New Styles.Bar()
        With loNewSerie
            .Title = "Silos Alimentation"
            .Color = Color.Blue
            .MultiBar = Styles.MultiBars.None
            .Pen.Visible = True
            .Pen.Color = Color.Black
            .DepthPercent = 30
            .XValues.DateTime = True
            .Marks.Visible = True
            .Marks.Clip = True
            .Marks.Color = Color.LightGoldenrodYellow
            .Marks.AutoSize = True
        End With 'poSerieProdNivAlim

        Return loNewSerie
And this is my Axis code:

Code: Select all

Dim loNewAxis As Axis = New Axis(False, False, teeChart.Chart)

        With loNewAxis
            .Automatic = False
            .AutomaticMaximum = False
            .AutomaticMinimum = False
            .StartPosition = 17
            .EndPosition = 27
            .Minimum = 0
            .Maximum = 100
            .Increment = 25
            .Title.Caption = "Silos (%)"
            .Title.Angle = 90
            .Title.AutoSize = True
            .Labels.AutoSize = True       End With 

        Return loNewAxis
I am using TeeChart .NET 4.1 Evaluation, we are currently migrating from .NET 2.26, and just wanted to make sure everything would go well with the new version before ordering!

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Marks increases Axis Maximum

Post by Sandra » Fri Feb 03, 2012 12:36 pm

Hello ArcUsers,

You can solve your problem using property MaximumOffset of Axis and assigning the value you want. You can do something as next code:

Code: Select all

Public Sub New()
	InitializeComponent()

	InitializeChart()
End Sub
Private bar1 As Steema.TeeChart.Styles.Bar

Private Sub InitializeChart()
	tChart1.Aspect.View3D = False
	bar1 = New Bar(tChart1.Chart)
	Dim rnd As New Random()
	For i As Integer = 0 To 9
		bar1.Add(i, rnd.[Next](100))
	Next
	bar1.Title = "Silos Alimentation"
	bar1.Color = Color.Blue
	bar1.Pen.Visible = True
	bar1.Pen.Color = Color.Black
	bar1.DepthPercent = 30
	bar1.Marks.Visible = True
	bar1.Marks.Clip = True
	bar1.Marks.Color = Color.LightGoldenrodYellow
	tChart1.Axes.Left.MaximumOffset = 5
End Sub
Can you tell us if previous works as you want?
I hope will help.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply