Assigning vertical axis changes Chart width.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Avatar
Newbie
Newbie
Posts: 26
Joined: Mon Mar 22, 2004 5:00 am
Location: Calgary Canada
Contact:

Assigning vertical axis changes Chart width.

Post by Avatar » Wed Feb 02, 2005 4:53 pm

Hi TChart,

I have a Chart with six standard line series. Each series has a separate vertical axis and a common bottom axis. I have three axes on the left and three on the right that correspond to each series.

TChartz.Axes.Bottom.Automatic = False
TChartz.Axes.Bottom.SetMinMax(StartDate, EndDate)
TChartz.Axes.Bottom.LabelsOnAxis = True
TChartz.Axes.Bottom.Labels.ExactDateTime = True
TChartz.Axes.Bottom.Labels.DateTimeFormat = "yyyy"
TChartz.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(DateTimeSteps.OneYear)


The user selects a series and places a drawline over a portion of that series.
Based on the endpoints of the drawline item the app creates a new series based on a certain function that will match the endpoints of the drawline item. The newly created series must be matched to the same vertical scale as the drawline item.

Dim NewLine as Short

Line1.CustomVertAxis = Me.Axis1
Line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Custom
TChartz.Series(NewLine).VertAxis = Line.VertAxis

This appears to work as far as the scaling goes but the entire chart redraws and either removes or pushes all the right axis of the screen and expands the bottom axis so TChartz.Axes.Bottom.Maximum is now to the far right of the screen.

Other than the initial scaling I never change the bottom axis and I can’t see what I have done wrong the assign a vertical axis would change the horizontal width.

PS. My other option was to use custom function to define the new series. This may still be an option?
Thanks

Pep
Site Admin
Site Admin
Posts: 3274
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Feb 11, 2005 11:11 am

Hi Avatar,

it should work fine using similar code to the following to assign the custom vertical axis to a new series :

Code: Select all

        Dim line2 As New Steema.TeeChart.Styles.Line
        line2.CustomVertAxis = TChart1.Axes.Custom(0)
        line2.FillSampleValues(10)
        TChart1.Series.Add(line2)

Post Reply