Class MakerChartScale
- Namespace
- SurvivorsMaker.Editor
- Assembly
- SurvivorsMaker.Editor.dll
Axis math shared by the charts: "nice" maxima and tick steps (1, 2, 2.5, 5 × 10^n).
public static class MakerChartScale
- Inheritance
-
MakerChartScale
- Inherited Members
Methods
Max(IEnumerable<float>)
Largest finite value of the series (0 when empty).
public static float Max(IEnumerable<float> values)
Parameters
valuesIEnumerable<float>
Returns
NearestIndex(float, float, float, int)
Index of the x slot nearest to x for count evenly spaced points over [left, right].
public static int NearestIndex(float x, float left, float right, int count)
Parameters
Returns
NiceMax(float)
Smallest nice number ≥ value. Non-positive or invalid values give 1.
public static float NiceMax(float value)
Parameters
valuefloat
Returns
Normalize(float, float)
Maps a value to 0–1 on an axis that runs 0..NiceMax(axisMax).
public static float Normalize(float value, float axisMax)
Parameters
Returns
NormalizeBetween(float, float, float)
public static float NormalizeBetween(float value, float min, float max)
Parameters
Returns
Short(float)
Short axis label: 1.2k, 3.4M.
public static string Short(float value)
Parameters
valuefloat
Returns
Ticks(float, int)
Tick values from 0 to NiceMax(max) in divisions equal steps.
public static float[] Ticks(float max, int divisions = 4)
Parameters
Returns
- float[]