protected override void DrawTicks(
Graphics g,
Point physicalMin,
Point physicalMax,
out object labelOffset,
out object boundingBox)
{
Point tLabelOffset;
Rectangle tBoundingBox;
labelOffset = this.getDefaultLabelOffset( physicalMin, physicalMax );
boundingBox = null;
// draw the tick labels (but not the ticks).
PointF lastPos = WorldToPhysical( (double)numbers_[0], physicalMin, physicalMax, true );
for (int i=0; i<labels_.Count; ++i)
{
if ((double)numbers_[i] > WorldMin && (double)numbers_[i] < WorldMax)
{
// check to make sure labels are far enough appart.
PointF thisPos = WorldToPhysical( (double)numbers_[i], physicalMin, physicalMax, true );
float dist = Utils.Distance( thisPos, lastPos );
if ( i==0 || (dist > this.PhysicalSpacingMin) )
{
lastPos = thisPos;
this.DrawTick( g, (double)numbers_[i], 0,
(string)labels_[i],
new Point(0,0),
physicalMin, physicalMax,
out tLabelOffset, out tBoundingBox );
Axis.UpdateOffsetAndBounds(
ref labelOffset, ref boundingBox,
tLabelOffset, tBoundingBox );
}
}
}
// now draw the ticks (which might not be aligned with the tick text).
ArrayList largeTickPositions;
ArrayList smallTickPositions;
WorldTickPositions_FirstPass( physicalMin, physicalMax, out largeTickPositions, out smallTickPositions );
lastPos = WorldToPhysical( (double)largeTickPositions[0], physicalMin, physicalMax, true );
for (int i=0; i<largeTickPositions.Count; ++i)
{
double tickPos = (double)largeTickPositions[i];
// check to see that labels are far enough appart.
PointF thisPos = WorldToPhysical( tickPos, physicalMin, physicalMax, true );
float dist = Utils.Distance( thisPos, lastPos );
if ( (i==0) || (dist> this.PhysicalSpacingMin) )
{
lastPos = thisPos;
this.DrawTick( g, tickPos, LargeTickSize,
"",
new Point(0,0),
physicalMin, physicalMax,
out tLabelOffset, out tBoundingBox );
Axis.UpdateOffsetAndBounds(
ref labelOffset, ref boundingBox,
tLabelOffset, tBoundingBox );
}
}
}