Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/screenshots/order.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/orders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/overview-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/overview-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion src/Enfilade/Charts/Chart.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
</div>

@code {
private const int MostLabels = 10;

private static readonly string[] Palette = [EnfiladeTheme.KleinGlow, EnfiladeTheme.Light, EnfiladeTheme.Ochre, EnfiladeTheme.Mist, EnfiladeTheme.Vermilion];

private List<ChartSeries<double>> _series = [];
Expand Down Expand Up @@ -39,7 +41,7 @@
{
var buckets = Buckets.Of(Trends, Step, From, To, Viewer.Zone);
var format = Format ?? (value => Words.Number((long)Math.Round(value)));
_labels = [.. buckets.Select(bucket => bucket.Start.ToString(LabelFormat, CultureInfo.CurrentCulture))];
_labels = Thinned([.. buckets.Select(bucket => bucket.Start.ToString(LabelFormat, CultureInfo.CurrentCulture))]);
_series = [.. Trends.Select((trend, index) => new ChartSeries<double>
{
Name = trend.Name,
Expand All @@ -50,6 +52,12 @@
: new LineChartOptions { ChartPalette = Palette, YAxisToStringFunc = format };
}

private static string[] Thinned(string[] labels)
{
var every = (int)Math.Ceiling(labels.Length / (double)MostLabels);
return [.. labels.Select((label, index) => index % every == 0 ? label : "")];
}

private string LabelFormat => Step switch
{
Period.Hour => "HH:mm",
Expand Down
2 changes: 1 addition & 1 deletion src/Enfilade/Layout/Navigation.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@inject ILogger<Navigation> Logger

<nav class="nav" aria-label="@EnfiladeText.Sections" @ref="_nav">
<span class="mark pigment" aria-hidden="true"></span>
<span class="mark" aria-hidden="true"></span>
@foreach (var entry in _shown)
{
if (entry is Section link)
Expand Down
Loading