Microsoft Office Tutorials and References
In Depth Information
Chart Examples
Figure 17-19: This fully functional clock is actually an XY chart in disguise.
The chart uses four data series: one for the hour hand, one for the minute hand, one for the
second hand, and one for the numbers. The last data series draws a circle with 12 points (but no
line). The numbers consist of manually entered data labels. In addition, I added an oval shape on
top of the chart.
The formulas listed in Table 17-2 use basic trigonometry to calculate the data series for the clock
hands. (The range G4:L4 contains zero values, not formulas.)
Table 17-2: Formulas Used to Generate a Clock Chart
Cell
Description
Formula
=0.5*SIN((HOUR(NOW())+(MINUTE(NOW())/60))*(2*PI()/12))
G5
Origin of hour
hand
H5
End of hour hand =0.5*COS((HOUR(NOW())+(MINUTE(NOW())/60))*(2*PI()/12))
=0.8*SIN((MINUTE(NOW())+(SECOND(NOW())/60))*(2*PI()/60))
I5
Origin of minute
hand
J5
End of minute
hand
=0.8*COS((MINUTE(NOW())+(SECOND(NOW())/60))*(2*PI()/60))
K5
Origin of second
hand
=0.85*SIN(SECOND(NOW())*(2*PI()/60))
=0.85*COS(SECOND(NOW())*(2*PI()/60))
L5
End of second
hand
This workbook uses a simple VBA procedure that schedules an event every second, which causes
the clock to run.

Search JabSto ::

Custom Search