ticks method
Returns approximately count representative values from the scale’s domain.
final x = ScaleLinear(
domain: [10, 100],
range: ["red", "blue"],
interpolate: interpolateRgb,
);
x.ticks(); // [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
If count
is not specified, it defaults to 10. The returned tick values
are uniformly spaced, have human-readable values (such as multiples of
powers of 10), and are guaranteed to be within the extent of the domain.
Ticks are often used to display reference lines, or tick marks, in
conjunction with the visualized data. The specified count
is only a
hint; the scale may return more or fewer values depending on the domain.
See also d4_array.ticks
.
Implementation
List<num> ticks([num count = 10]) {
var d = domain;
return d4_array.ticks(d[0], d[d.length - 1], count);
}