Axis.PositionUnits constants

TeeChart for ActiveX, COM and ASP
Post Reply
AHIS
Newbie
Newbie
Posts: 19
Joined: Wed Feb 22, 2006 12:00 am
Location: Austria

Axis.PositionUnits constants

Post by AHIS » Mon Apr 03, 2006 9:56 am

Hi.

I need to set the StartPosition and EndPosition of a CustomAxis in Pixels. By default it is in percent. The documentation only lists the EPositionUnits with the constants puPercent and puPixels. But I CANT use the Enum constants because it isnt supported in my development environment. So I would need something like puPercent = 0, puPixels = 1.
I already tried 0 and 1 but the Unit always remains percent.

thanks for any help!

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

Post by Narcís » Mon Apr 03, 2006 10:09 am

Hi AHIS,

As you can see in TeeChartDefines.h at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual C++ the constants are:

// EPositionUnits
const unsigned long puPercent = 0;
const unsigned long puPixels = 1;


If the problem persists, could you please send us an example we can run "as-is" to reproduce the problem here?

Thanks in advance.
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

AHIS
Newbie
Newbie
Posts: 19
Joined: Wed Feb 22, 2006 12:00 am
Location: Austria

Post by AHIS » Mon Apr 03, 2006 11:05 am

I dont think I can send you any example that runs 'as-is' because I have the TChart-OCX integrated in a Progress Programming Environment...
But I set the following things:

chTChartRowManager.TChart.AddSeries(0).
chTChartRowManager.TChart.Series(0).asLine.Pointer.VISIBLE = TRUE.
chTChartRowManager.TChart.Series(0).asLine.Pointer.HorizontalSize = 3.
chTChartRowManager.TChart.Series(0).asLine.Pointer.VerticalSize = 3.
chTChartRowManager.TChart.Series(0).ShowInLegend = TRUE.
chTChartRowManager.TChart.Series(0).TITLE = "myLine".
chTChartRowManager.TChart.Series(0).VerticalAxisCustom = chTChartRowManager.TChart.Axis.AddCustom(FALSE).
chTChartRowManager.TChart.Series(0).VerticalAxis = 3.

chTChartRowManager.TChart.Axis.Custom(0).MAXIMUM = 50.
chTChartRowManager.TChart.Axis.Custom(0).MINIMUM = 0.
chTChartRowManager.TChart.Axis.Custom(0).PositionUnits = 1.
chTChartRowManager.TChart.Axis.Custom(0).EndPosition = 85.
chTChartRowManager.TChart.Axis.Custom(0).StartPosition = 40.
chTChartRowManager.TChart.Axis.Custom(0).AUTOMATIC = FALSE.
chTChartRowManager.TChart.Axis.Custom(0).GridCentered = FALSE.
chTChartRowManager.TChart.Axis.Custom(0).Increment = 10.
chTChartRowManager.TChart.Axis.Custom(0).GridPen.VISIBLE = FALSE.
chTChartRowManager.TChart.Axis.Custom(0).MinorTicks.VISIBLE = FALSE.
chTChartRowManager.TChart.Axis.Custom(0).MinorGrid.VISIBLE = FALSE.

chTChartRowManager.TChart.Legend.VISIBLE = TRUE.
chTChartRowManager.TChart.Legend.ResizeChart = TRUE.
chTChartRowManager.TChart.Legend.CheckBoxes = TRUE.
chTChartRowManager.TChart.Legend.Alignment = 3.
chTChartRowManager.TChart.Legend.Series = 0.


The PositionUnits = 1 only seems to work with PositionPercent but not with Start/EndPosition!

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

Post by Narcís » Wed Apr 05, 2006 12:40 pm

Hi AHIS,

PositionUnits is only to set PositionPercent units.

What you request can not be done directly. However, you can do it manually using a function like that:

Code: Select all

  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
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

AHIS
Newbie
Newbie
Posts: 19
Joined: Wed Feb 22, 2006 12:00 am
Location: Austria

Post by AHIS » Thu Apr 13, 2006 8:29 am

Hi Narcis.

Now I have managed to position my axis correctly with Start/EndPosition. But there is the following problem:
For example I draw the axis from 25% to 75% with Minimum 0 and Maximum 100. The series itself is from type 'asLine'. If I add a point using AddXY with Y larger than Maximum the line is drawn outside the Start/EndPosition using the whole ChartCanvas! That is not what I want.

appreciate any help!

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 Apr 13, 2006 8:47 am

Hi AHIS,

Then you should do as in the Opaque zones example at TeeChart features demo. The example is at All Features\Welcome !\Axes.
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

Post Reply