public static ChartSegment WithDurationFormat(this ChartSegment segment, DurationFormat durationFormat) => new ChartSegment( segment.ProjectName, segment.Percentage, (float)segment.TrackedTime.TotalSeconds, segment.BillableSeconds, segment.Color, durationFormat);
public static string FormattedName(this ChartSegment segment) => segment.ProjectName.TruncatedAt(maxSegmentNameLength);