Code: Select all
Const cDateXOffset = 20 ' Horiz. distance between end of X axis and where to display date text
nLineHeight = g_nLegendFontSize * TChart1.Axis.Left.Labels.Font.PixelsPerInch / 72 + 1
nDateXPos = TChart1.Axis.Right.Position + TChart1.Aspect.Width3D - (8*cDateXOffset - 10)
nDateYPos = TChart1.Canvas.Top - 60
nDateYPos = nDateYPos + nLineHeight*4
.Font.Color = vbBlack
sDateTime = FormatDateTime(g_dtMaxTime, vbShortDate)
if sDateTime <> "" then
sTime = FormatDateTime(g_dtMaxTime, vbLongTime)
.TextOut nDateXPos, nDateYPos, " Date : "& DateValue(sDateTime)
.TextOut nDateXPos, nDateYPos + nLineHeight, " Time : " & TimeValue(sTime)
end if
Date: formatteddate Time: formattedtime
where the formatted date and times represent the regional date/time formats
Thank you,
Scott Small