Page 1 of 1

PositionUnits --> Start/EndPosition and RelativePosition.

Posted: Thu Dec 29, 2005 9:23 am
by 9524350
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

Posted: Mon Jan 02, 2006 12:15 pm
by Chris
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

Posted: Mon Jan 02, 2006 5:49 pm
by 9524350
Thanks for this response.

It's exactly what I need.

Best regards.