assignMissingColors method
void
assignMissingColors(
- Iterable<
MutableSeries< seriesList, {D> > - required bool emptyCategoryUsesSinglePalette,
Assigns colors to series that are missing their colorFn.
Implementation
@override
void assignMissingColors(Iterable<MutableSeries<D>> seriesList,
{required bool emptyCategoryUsesSinglePalette}) {
var maxMissing = 0;
seriesList.forEach((series) {
if (series.colorFn == null) {
maxMissing = max(maxMissing, series.data.length);
}
});
if (maxMissing > 0) {
final colorPalettes = StyleFactory.style.getOrderedPalettes(1);
final colorPalette = colorPalettes[0].makeShades(maxMissing);
seriesList.forEach((series) {
series.colorFn ??= (index) => colorPalette[index!];
});
}
}