Scales are the bridge between raw data values and the pixel positions, colors, or sizes you see in a chart. Taucharts registers ten scale types internally and selects the right one automatically based on your data, but you can override the choice using theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TargetProcess/tauCharts/llms.txt
Use this file to discover all available pages before exploring further.
dimensions property and fine-tune behaviour through the guide.
Registered scale types
| Scale | Key | Use case |
|---|---|---|
identity | identity | Internal use; maps values directly to themselves |
color | color | Maps dimension values to colors from the color brewer |
fill | fill | Choropleth fill colors on map charts |
size | size | Maps numeric values to point radius |
ordinal | ordinal | Discrete categories with equal spacing |
period | period | Time axis snapped to calendar periods (day, week, month, …) |
time | time | Continuous time axis using d3 time scales |
linear | linear | Continuous numeric axis |
logarithmic | logarithmic | Continuous numeric axis with logarithmic spacing |
value | value | Internal use for pass-through values |
dimensions[field].scale are ordinal, period, time, linear, and logarithmic.
Setting a scale
Override the auto-detected scale for any field in thedimensions map:
Ordinal scale
The ordinal scale maps discrete string values to evenly spaced positions. It is the default forcategory and order dimension types.
order array on an order-type dimension:
Linear scale
The linear scale is the default for finite numeric fields. Configure the axis domain bounds and rounding via theguide:
[min, max] are drawn at the boundary rather than overflowing.
Time scale
The time scale maps JavaScriptDate objects (or ISO strings coerced to dates) to a continuous axis. Taucharts uses d3’s scaleTime locally and scaleUtc when utcTime is enabled.
UTC mode
SetutcTime: true in settings to interpret all time values as UTC instead of local time. This affects axis tick alignment, tick format output, and period boundaries.
Tick periods
Combine the time scale withtickPeriod in the guide to snap ticks and labels to calendar boundaries:
day, week, month, quarter, year.
Period scale
The period scale is a discrete variant of the time scale. It snaps values to the start of the nearest period boundary, making each period a uniform-width band rather than a proportional interval.Rows where a
period-scale field is null are excluded from rendering by default, the same as measure fields. See excludeNull in Chart settings.Logarithmic scale
Use the logarithmic scale for numeric data that spans several orders of magnitude:min and max guide options work the same as with the linear scale. Avoid zero or negative values in the domain—they cannot be represented on a log scale.
Custom tick periods
Register a new named period withTaucharts.api.tickPeriod.add(). A period definition requires two functions: cast snaps a date to the start of its period, and next advances a date by one period.
Custom tick formats
Register a named formatter withTaucharts.api.tickFormat.add(). The function receives the raw tick value and must return a string.