Table of Contents

Interface ITimeUnit

Namespace
ScottPlot.TickGenerators
Assembly
ScottPlot.dll
public interface ITimeUnit
Extension Methods

Properties

Divisors

An array of integers that serve as good divisors to subdivide this time unit

IReadOnlyList<int> Divisors { get; }

Property Value

IReadOnlyList<int>

MinSize

Minimum span this time unit can represent. To represent spans smaller than this, try the next smaller unit.

TimeSpan MinSize { get; }

Property Value

TimeSpan

Methods

GetDateTimeFormatString()

Returns the format string used to display tick labels of this time unit. https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tostring

string GetDateTimeFormatString()

Returns

string

Next(DateTime, int)

Return the DateTime N units relative to this one

DateTime Next(DateTime dateTime, int increment = 1)

Parameters

dateTime DateTime
increment int

Returns

DateTime

Snap(DateTime)

Return a given date "snapped" back to the nearest nice tick position. Use this to find a good tick position for a given DateTime.

DateTime Snap(DateTime dateTime)

Parameters

dateTime DateTime

Returns

DateTime