Constructors
TickLayout
#Create a new numberline layout. Note you would almost never do this yourself, as the Create(LineF, decimal, decimal, Properties) and Create(RectangleF, decimal, decimal, Properties) methods do all the heavy lifting. You only need to populate your own numberline layout if you want non-standard things such as custom formatting or non-linear mapping.
Properties
Indexers
Methods
Create
#Create a number line layout with an explicit finest tick class. Unlike Create(LineF, decimal, decimal, Properties) the visibility of ticks is not derived from their spacing. Every power-of-ten class is either drawn or not, and its tick length is supplied by the caller, which allows the caller to animate classes in and out over time. Labels are organised in rungs, from coarse to fine: all labels of a class, then the halfway labels between them, then all labels of the class below, and so on. A rung fits when its label pitch exceeds the widest label visible at that rung.
public static TickLayout Create()
axis,
Visible portion of the numberline. Must be strictly horizontal.
t0,
Limit value along left end of axis.
t1,
Limit value along right end of axis.
properties,
Properties.
finest,
Exponent of the finest tick class. Ticks of this class are drawn in the SHORT style, coarser ticks in the LONG style. Labels are only considered for the finest class and coarser.
tickLength,
Pixel length per power-of-ten class exponent. Zero or less means the class is not drawn. The class directly below the finest one is included while it still has a positive length, so it can animate away.
labelOpacity
Opacity per label rung. Callers that do not animate can return one when the rung fits and zero otherwise.
Create
#Create a number line layout.
public static TickLayout Create()
axis,
Visible portion of the numberline. Must be strictly horizontal.
t0,
Limit value along left end of axis.
t1,
Limit value along right end of axis.
properties
Properties.
Create
#Create a number line layout within a box.
public static TickLayout Create()
RectangleF
bounds,
Bounds. The number-line will either be aligned along the top, middle or bottom of the bounds depending on the tick and label style.
t0,
Limit value along left end of box.
t1,
Limit value along right end of box.
properties
Properties.
Draw
#Draw this layout to a graphics context.
FormatLabel
#Format a tick label. Round values of a hundred thousand and up use an SI prefix (k, M, G, T) so that 10,000,000 reads as 10M. Tick values are small multiples of a power of ten, so the mantissa is always short.
Returns: Label text.
SmallestTickExponent
#Compute the power-of-ten exponent of the smallest tick class that would be laid out along an axis of the given range and pixel width.
Returns: Exponent e such that the smallest ticks are 10^e apart.
ToInfiniteSnapSpace
#Create a snapping space based on this numberline. Snapping will occur on the infinite line, based on some subdivision of the smallest visible ticks.