Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart axes type #834

Merged
merged 3 commits into from
Aug 9, 2024
Merged
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
39 changes: 25 additions & 14 deletions blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ChartOptions : IChartOptions
/// <see href="https://www.chartjs.org/docs/latest/configuration/responsive.html#configuration-options" />.
/// </summary>
/// <remarks>
/// Default value is <see langword="true"/>.
/// Default value is <see langword="true" />.
/// </remarks>
public bool MaintainAspectRatio { get; set; } = true;

Expand All @@ -36,10 +36,10 @@ public class ChartOptions : IChartOptions

/// <summary>
/// Resizes the chart canvas when its container does.
/// <see href="https://www.chartjs.org/docs/latest/configuration/responsive.html#configuration-options" />. ///
/// <see href="https://www.chartjs.org/docs/latest/configuration/responsive.html#configuration-options" />. ///
/// </summary>
/// <remarks>
/// Default value is <see langword="false"/>.
/// Default value is <see langword="false" />.
/// </remarks>
public bool Responsive { get; set; }

Expand All @@ -58,7 +58,7 @@ public class ChartLayout
/// Apply automatic padding so visible elements are completely drawn.
/// </summary>
/// <remarks>
/// Default value is <see langword="true"/>.
/// Default value is <see langword="true" />.
/// </remarks>
public bool AutoPadding { get; set; } = true;

Expand All @@ -71,7 +71,7 @@ public class ChartLayout
}

/// <summary>
/// Namespace: options.interaction, the global interaction configuration is at Chart.defaults.interaction.
/// Namespace: options.interaction, the global interaction configuration is at Chart.defaults.interaction.
/// <see href="https://www.chartjs.org/docs/latest/configuration/interactions.html#interactions" />.
/// </summary>
public class Interaction
Expand Down Expand Up @@ -122,7 +122,7 @@ private void SetMode(InteractionMode interactionMode) =>
/// if <see langword="true" />, the interaction mode only applies when the mouse position intersects an item on the chart.
/// </summary>
/// <remarks>
/// Default value is <see langword="true"/>.
/// Default value is <see langword="true" />.
/// </remarks>
public bool Intersect { get; set; } = true;

Expand All @@ -140,10 +140,10 @@ public InteractionMode Mode
}
}

#endregion

//includeInvisible
//https://www.chartjs.org/docs/latest/configuration/interactions.html#interactions

#endregion
}

public enum InteractionMode
Expand All @@ -160,11 +160,22 @@ public class Scales
{
#region Properties, Indexers

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxes? X { get; set; } = new();
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxes? X { get; set; } = new();

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxes? Y { get; set; } = new();

#endregion
}

public class ChartAxesType
{
#region Fields and Constants

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxes? Y { get; set; } = new();
public static readonly string Linear = "linear";
public static readonly string Logarithmic = "logarithmic";
public static readonly string Category = "category";
public static readonly string Time = "time";
public static readonly string Timeseries = "timeseries";

#endregion
}
Expand Down Expand Up @@ -232,10 +243,10 @@ public class ChartAxes
public ChartAxesTitle? Title { get; set; }

/// <summary>
/// Gets or sets the index scale type.
/// Gets or sets the index scale type. See <see cref="ChartAxesType" />.
/// </summary>
/// <remarks>
/// Default value is <see langword="null"/>.
/// Default value is <see langword="null" />.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Type { get; set; }
Expand Down
Loading