Page 1 of 1

bottom axis x-value vs addxy-label

Posted: Fri Mar 14, 2008 9:20 am
by 9535493
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

Posted: Fri Mar 14, 2008 10:27 am
by narcis
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!

annotation behaving in zoomed chart

Posted: Mon Mar 17, 2008 1:00 pm
by 9535493
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)
...

Posted: Mon Mar 17, 2008 1:19 pm
by narcis
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

Posted: Tue Mar 18, 2008 6:57 am
by 9535493
thanks, change of labels.style solved it

adenin