bottom axis x-value vs addxy-label

TeeChart for ActiveX, COM and ASP
Post Reply
adenin
Newbie
Newbie
Posts: 33
Joined: Mon Jun 11, 2007 12:00 am

bottom axis x-value vs addxy-label

Post by adenin » Fri Mar 14, 2008 9:20 am

Hello,

Please, is it possible to have displayed Date (14.3.2008 0:54:53) as label for bottom axis and not label? (0845335051000)
with such data:

TChartSpeed.Series(1).AddXY CDate("14.3.2008 0:54:53"), 943.61 , "0845335051000" , RGB(200,0,0)


because I want this label to use in annotation tool when moving mouse cursor over chart
thanks

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

Post by Narcís » Fri Mar 14, 2008 10:27 am

Hi adenin,

Yes, you can do something like this:

Code: Select all

    TChart1.Series(0).XValues.DateTime = True
    TChart1.Axis.Bottom.Labels.DateTimeFormat = "dd.mm.yyyy hh:mm:ss"
    TChart1.Axis.Bottom.Labels.Style = talValue
    
    TChart1.Tools.Items(0).asAnnotation.Text = CStr(CDate(TChart1.Series(0).XValues.Value(0)))
Hope this helps!
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

adenin
Newbie
Newbie
Posts: 33
Joined: Mon Jun 11, 2007 12:00 am

annotation behaving in zoomed chart

Post by adenin » Mon Mar 17, 2008 1:00 pm

hello Narcis,

problem is that after I use some string instead of empty one in AddXY,
I get labels for bottomaxis from this string

so series created with those:

TChartSpeed.Series(1).AddXY CDate("14.3.2008 0:54:53"), 943.61 , "" , RGB(200,0,0)
TChartSpeed.Series(1).AddXY CDate("14.3.2008 1:54:53"), 1943.61 , "" , RGB(200,0,0)
TChartSpeed.Series(1).AddXY CDate("14.3.2008 2:54:53"), 2943.61 , "" , RGB(200,0,0)

has Date values below bottomaxis;
series created with these:

TChartSpeed.Series(1).AddXY CDate("14.3.2008 0:54:53"), 943.61 , "A" , RGB(200,0,0)
TChartSpeed.Series(1).AddXY CDate("14.3.2008 1:54:53"), 943.61 , "B" , RGB(200,0,0)
TChartSpeed.Series(1).AddXY CDate("14.3.2008 2:54:53"), 943.61 , "C" , RGB(200,0,0)

has "A","B","C" as labels for bottomaxis.

my desire is to use second way and have date values below bottom axis
and have possibility to display "A", "B" or "C" string using onmousemove and annotation tool:

...
.asAnnotation.Text = TChartSpeed.Series(1).PointLabel(mouseOverIndex)
...

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 17, 2008 1:19 pm

Hi adenin,

Thanks for the information. In tha case, setting Labels.Style to talValue as shown in the code I posted before should do.

For displaying labels the easiest way would be using a MarksTip tool set to display series labels, for example:

Code: Select all

    TChart1.Tools.Items(0).asMarksTip.Series = TChart1.Series(0)
    TChart1.Tools.Items(0).asMarksTip.Style = smsLabel
    TChart1.Tools.Items(0).asMarksTip.MouseAction = mtmMove
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

adenin
Newbie
Newbie
Posts: 33
Joined: Mon Jun 11, 2007 12:00 am

Post by adenin » Tue Mar 18, 2008 6:57 am

thanks, change of labels.style solved it

adenin

Post Reply