BandScale
public class BandScaleBand scale for categorical data. Maps discrete categories to continuous range.
Constructors
Section titled “Constructors”
BandScale(string[], float, float)
Section titled “BandScale(string[], float, float)”public BandScale(string[] categories, float rangeMin = 0, float rangeMax = 1)Creates evenly spaced categorical bands across the output range. A null category array produces an empty scale.
Parameters
| Name | Type |
|---|---|
categories |
System.String[] |
rangeMin |
System.Single |
rangeMax |
System.Single |
Methods
Section titled “Methods”
SetRange(float, float)
Section titled “SetRange(float, float)”public BandScale SetRange(float min, float max)Replaces the output coordinate interval and recalculates band positions and widths.
Parameters
| Name | Type |
|---|---|
min |
System.Single |
max |
System.Single |
Returns
ChartGuru.BandScale
SetPaddingInner(float)
Section titled “SetPaddingInner(float)”public BandScale SetPaddingInner(float padding)Sets the proportional gap between adjacent bands, clamped from zero to one, and recalculates layout.
Parameters
| Name | Type |
|---|---|
padding |
System.Single |
Returns
ChartGuru.BandScale
SetPaddingOuter(float)
Section titled “SetPaddingOuter(float)”public BandScale SetPaddingOuter(float padding)Sets the proportional margin before the first and after the last band, clamped from zero to one.
Parameters
| Name | Type |
|---|---|
padding |
System.Single |
Returns
ChartGuru.BandScale
SetPadding(float)
Section titled “SetPadding(float)”public BandScale SetPadding(float padding)Applies one clamped proportion to both inner gaps and outer margins, then recalculates layout.
Parameters
| Name | Type |
|---|---|
padding |
System.Single |
Returns
ChartGuru.BandScale
Map(string)
Section titled “Map(string)”public float Map(string category)Map a category to its band start position.
Parameters
| Name | Type |
|---|---|
category |
System.String |
Returns
System.Single
Map(int)
Section titled “Map(int)”public float Map(int index)Map a category index to its band start position.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
Returns
System.Single
MapCenter(string)
Section titled “MapCenter(string)”public float MapCenter(string category)Get the center of a band for the category.
Parameters
| Name | Type |
|---|---|
category |
System.String |
Returns
System.Single
MapCenter(int)
Section titled “MapCenter(int)”public float MapCenter(int index)Get the center of a band for the index.
Parameters
| Name | Type |
|---|---|
index |
System.Int32 |
Returns
System.Single
Invert(float)
Section titled “Invert(float)”public int Invert(float position)Find which category contains the given position.
Parameters
| Name | Type |
|---|---|
position |
System.Single |
Returns
System.Int32
Properties
Section titled “Properties”
Categories
Section titled “Categories”public string[] Categories { get; }Returns
System.String[]
public float2 Range { get; }Returns
Unity.Mathematics.float2
Bandwidth
Section titled “Bandwidth”public float Bandwidth { get; }Returns
System.Single
public float Step { get; }Returns
System.Single