how to find the x-axis position ?

TeeChart for ActiveX, COM and ASP
daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

how to find the x-axis position ?

Post by daryl » Mon Mar 19, 2007 12:30 pm

how to find the x-axis position ?

when we plot any graph x and y -axis , i would lik to know the x-axis coordinates drawn in the tchart (say x=530,y=120 where tchart height =650 and 700)

and also when we insert the legend on the bottom / changing the label in the x-axis to 90% is moving the x-axis little bit up , but i would like to know the exact value of the x-axis .

reply asap

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 Mar 19, 2007 2:22 pm

Hi daryl,
when we plot any graph x and y -axis , i would lik to know the x-axis coordinates drawn in the tchart (say x=530,y=120 where tchart height =650 and 700)
You can obtain pixel screen coordinates from values using this:

Code: Select all

    X = TChart1.Axis.Bottom.CalcXPosValue(530)
    Y = TChart1.Axis.Left.CalcYPosValue(120)
Values from screen coordinates like this:

Code: Select all

    XVal = TChart1.Axis.Bottom.CalcPosPoint(650)
    YVal = TChart1.Axis.Left.CalcPosPoint(700)
and also when we insert the legend on the bottom / changing the label in the x-axis to 90% is moving the x-axis little bit up , but i would like to know the exact value of the x-axis .
You can obtain axis positions like this:

Code: Select all

    TChart1.Axis.Bottom.Position
    TChart1.Axis.Bottom.StartPosition
    TChart1.Axis.Bottom.EndPosition
Last edited by Narcís on Mon Mar 19, 2007 4:01 pm, edited 1 time in total.
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

daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

posted word document with details inside

Post by daryl » Mon Mar 19, 2007 3:57 pm

posted word document pls go through and reply me asap

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 Mar 19, 2007 4:01 pm

Hi daryl,

I think that you should use CalcXPosValue method. All methods are fully described in TeeChart's documentation.
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

daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

Post by daryl » Mon Mar 19, 2007 4:07 pm

if you plot the graph and check the calcposxvalue it is not returning the huge value

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 Mar 19, 2007 4:09 pm

Hi daryl,

Sorry but I don't understand what do you exactly mean. Could you please give us some more details about your problem?

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

daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

Post by daryl » Mon Mar 19, 2007 4:36 pm

i have posted in the word document

for 2004 series in the graph y value is 202 and 752 for 2 points
in order to place/move the marks in the middle

for point 1 = (202- XAXIS.XVALUE )/2 + 202 so that it moves to the middle

similarly for point 2in 2004 =(752-202)/2 + 752

NOW SERIES ONE AND POINT 1 ONLY I HAVE issue because starting value is unknown but where as rest of the points i have 2 values .


so i need to find this starting value

Note: moving this marks to centre for stacked graph

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

Post by Narcís » Tue Mar 20, 2007 8:28 am

Hi daryl,

Sorry but I still don't understand what are you exactly trying to achieve here. I'm afraid you are mixing X and Y coordinates here. Could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know how would you expect marks to be drawn?

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

daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

Post by daryl » Tue Apr 03, 2007 10:00 am

Sample vb application is enclosed which replicates the Moving the marks into centre for stackgraph .

Once you go through the app ,you will be able to get an idea of wat my requirement , how ever requirement is achieved with an assumed x-axis position but to be precise , i need to know how to find the x-axis position


. Could you Pls reply ASAP

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

Post by Narcís » Tue Apr 03, 2007 11:11 am

Hi daryl,

As I told you in previous messages, you can calculate bottom axis position much easily using TChart1.Axis.Bottom.Position. Have you tried using this?
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

daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

Post by daryl » Tue Apr 03, 2007 11:14 am

i tried but it is not giving exact value, if you open the sample application which i sent , and using yourmethod find the value and compare with my value in the app ,

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

Post by Narcís » Tue Apr 03, 2007 12:07 pm

Hi daryl,

I've made a little modification to your project for calculation marks position. You can see the code below and this should be independent of legend's position or labels angle. I've also attached modified project at the newsgroups.

Code: Select all

       With TChart1.Series(i).Marks
        'MarkHeight = ((.ShapeBounds.Bottom - .ShapeBounds.Top))
        MarkHeight = 10

        .Arrow.Visible = False
        If i = 0 Then
            .Positions.Position(j).LeftTop.Y = TChart1.Axis.Bottom.Position + ((TChart1.Series(i).CalcYPos(j) - TChart1.Axis.Bottom.Position) / 2) - MarkHeight
        Else
            .Positions.Position(j).LeftTop.Y = TChart1.Series(i - 1).CalcYPos(j) + ((TChart1.Series(i).CalcYPos(j) - TChart1.Series(i - 1).CalcYPos(j)) / 2) - MarkHeight
        End If
       End With
Is this solution acceptable for you?
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

daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

Post by daryl » Tue Apr 03, 2007 12:55 pm

Hi Narcis ,

Thanks for the code

I have another kind of graph i.e. scArea with stacked 100% and stairs for this I want to keep the marks in centre how can I do , I am enclosed the sample project in the mail

Pls check and respond

Thanks
aravind

"Narcís Calvet" <support@steema.com> wrote in message news:<cesp0jedHHA.408@TEEPC.Steema.local>...
> Hi aravind,
>
> Please find attached your project modified as I told you in the forums.
>
>
> --
> Best Regards,
>
> Narcis Calvet
> Steema Support Central
> http://support.steema.com
>
> "Important note: If you are a TeeChart registered customer, please post your
> support questions at Steema's Support monitored Forums for customers:
> http://support.steema.com for a prompter reply."
>
> aravind wrote:
> > Sample vb application is enclosed . Could you Pls reply ASAP
>
>
>
>

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

Post by Narcís » Tue Apr 03, 2007 1:22 pm

Hi daryl,

The same code I posted before works fine for this example. Have you tried using it there? If it is not what are you exactly looking for a similar approach should be used.
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

daryl
Newbie
Newbie
Posts: 91
Joined: Thu Sep 09, 2004 4:00 am
Location: UK
Contact:

Post by daryl » Tue Apr 03, 2007 1:46 pm

like in the stack graph , marks has to be moved in thecentre .when i use this code ,it stays on the to and does not move

Post Reply