Panel margins and custom axis labels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Panel margins and custom axis labels

Post by norman » Wed Feb 13, 2008 5:19 pm

Hi,

I'm adding a number of custom vertical axis and associated series at run time to achieve a stacked effect but have noticed that the leftmost extent of the axes labels are not visible. I see how I can increase the Panel LeftMargin to rectify this but is there anyway of autosizing the panel so that all labels are automatically visible?

Thanks,

Norman

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 14, 2008 10:53 am

Hi Norman,

Yes, you could try setting label's CustomSize, for example:

Code: Select all

						tChart1.Axes.Left.Labels.CustomSize = 50;
Also please notice that some series styles already support stacking. If you could provide some details about what you are trying to achieve we could suggest how to make it with TeeChart.
Best Regards,
Narcís Calvet / 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

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Thu Feb 14, 2008 12:20 pm

Hi Narcís,

Thanks for the reply and the tip. When I applied the setting to my custom axis I see it had the affect of moving the series title closer to the vertical axis - which is useful and good to know. The axis value labels (i.e. those whose format is determined by the labels.valueformat property) remain unaffected. Is it possible to set the size of these also? It's not so important as I've added end user functionality to allow authorized users set the value format and panel margins preferences to address this type of thing.

In order to achieve the stacked affect (i.e. where a number of series share a common x-axis [datetime] but have their own y axis) I'm use the following logic:

1. Create a new line series
2. Add the series to the chart
3. Create a new axis defining a start and end position (e.g series #1 may have settings of 0 and 50 and series #2 may have settings of 50 and 100)
4. Add the axis to the chart
5. Set the series CustomVertAxis property to the axis created in step 3

It seems to work however I'd be happy to know of any other possible stacking capabilities.

Thanks again,

Norman

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 14, 2008 12:57 pm

Hi Norman,
The axis value labels (i.e. those whose format is determined by the labels.valueformat property) remain unaffected. Is it possible to set the size of these also?
I'm afraid I don't understand what you mean here as I think CustomSize should do this.
It seems to work however I'd be happy to know of any other possible stacking capabilities.
This seems fine to me. You can find more example of this at All Features\Welcome !\Axes in the features demo available at TeeChart's program group. I thought you were trying to stack series as in the following examples in the features demo: All Features\Welcome !\Chart styles\Standard\Line(Strip)\Stack and Overlap, Welcome !\Chart styles\Standard\Bar\Negative stacked and All Features\Welcome !\Chart styles\Standard\Area\Stack Groups.
Best Regards,
Narcís Calvet / 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

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Thu Feb 14, 2008 1:27 pm

Hi Narcís,

Mmmm not sure what's up

I have the following

Code: Select all

dim myaxis as steema.teechart.axis
with myaxis
   .title.angle = 90
   .title.caption = "my series"
   .labels.valueformat = "#,###.00"
   .labels.customsize = 10
end with
If I omit the customsize property "my series" will appear to the left of the axis value labels (i.e. from left to right you have caption, value labels and then axis). If I include the customsize property the caption moves right closer to the axis and actually appears behind the value labels.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 14, 2008 2:24 pm

Hi norman,

Ok, thanks for the information.

In that case you can combine panel's left margin and CustomSize as in the code example below.

Code: Select all

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim line1 As New Steema.TeeChart.Styles.Line(TChart1.Chart)
        line1.FillSampleValues()

        Dim myaxis As New Steema.TeeChart.Axis(False, False, TChart1.Chart)

        TChart1.Axes.Custom.Add(myaxis)
        line1.CustomVertAxis = myaxis

        TChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels
        TChart1.Panel.MarginLeft = 90

        With myaxis
            .Title.Angle = 90
            .Title.Caption = "my series"
            .Labels.ValueFormat = "#,###.00"
            .Labels.CustomSize = 60
        End With

    End Sub
Best Regards,
Narcís Calvet / 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

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Thu Feb 14, 2008 2:35 pm

Hi Narcís,

Ok great - thanks for all your help.

Post Reply