PositionUnits --> Start/EndPosition and RelativePosition.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ACTL
Newbie
Newbie
Posts: 14
Joined: Thu Sep 30, 2004 4:00 am

PositionUnits --> Start/EndPosition and RelativePosition.

Post by ACTL » Thu Dec 29, 2005 9:23 am

Hello,

Your latest dotnet version 2.0.2179.21121 fix the Bugfixes/changes n° 24 "Series Labels and DateTime values were not properly displayed when using DBNull values in databases. Fixed.".
For this reason, I use this new version.

But in the same time, you insert the new functionnality n°3 "Axis.StartPosition and Axis.EndPosition can now be defined in Pixels using Axis.PositionUnits."!

If you use the simple application above, you will see that when you click on the button (Set the PositionUnits in pixel):
- The axe is correctly positionned at -10 pixel of the left axe.
- BUT the startposition and endposition are translated in pixel with the default values 0 and 100!
The customvertical axis in then positionned at 0 pixel (Upper left corner -10 pixels) and with a lenght of 100 pixels!

For my application, I would like to have the RelativePosition in pixel and the Start/EndPosition in percent (In fact 0/100).
Can you tel me if its possible to do this or if the next version can contains this functionnality.

Thanks in advance.

Example:
TChart1.Series(0).FillSampleValues(50)
Dim SerieAxis As Steema.TeeChart.Axis
SerieAxis = New Steema.TeeChart.Axis(False, False, TChart1.Chart)
TChart1.Axes.Custom.Add(SerieAxis)
TChart1.Series(0).CustomVertAxis = SerieAxis
TChart1.Panel.MarginLeft = 30
SerieAxis.RelativePosition = -10
SerieAxis.PositionUnits = Steema.TeeChart.PositionUnits.Pixels

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Jan 02, 2006 12:15 pm

Hi -

You're right, this is a problem which we will look into before the next maintenance release. In the meantime, you can workaround the issue using code similar to the following:

Code: Select all

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TChart1.Series(0).FillSampleValues(50)
        Dim SerieAxis As Steema.TeeChart.Axis
        SerieAxis = New Steema.TeeChart.Axis(False, False, TChart1.Chart)
        TChart1.Axes.Custom.Add(SerieAxis)
        TChart1.Series(0).CustomVertAxis = SerieAxis
        TChart1.Panel.MarginLeft = 30
        SerieAxis.RelativePosition = GetPercentageFromPixels(10) * -1
    End Sub

    Private Function GetPercentageFromPixels(ByVal pixels As Double) As Double
        Dim bmp As Bitmap = TChart1.Bitmap 'to recalculate chartrect
        Dim rect As Rectangle = TChart1.Chart.ChartRect
        Return pixels / (rect.Width / 100)
    End Function
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

ACTL
Newbie
Newbie
Posts: 14
Joined: Thu Sep 30, 2004 4:00 am

Post by ACTL » Mon Jan 02, 2006 5:49 pm

Thanks for this response.

It's exactly what I need.

Best regards.

Post Reply