-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and improve axis-tick configurations (#68)
* Fix inheritance and summaries, add/organize properties * Update xml-docs
- Loading branch information
1 parent
64bb35c
commit 283666c
Showing
10 changed files
with
127 additions
and
156 deletions.
There are no files selected for viewing
37 changes: 24 additions & 13 deletions
37
src/ChartJs.Blazor/ChartJS/Common/Axes/Ticks/CartesianTicks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,61 @@ | ||
namespace ChartJs.Blazor.ChartJS.Common.Axes.Ticks | ||
{ | ||
/// <summary> | ||
/// The base class for all tick mark configurations of cartesian axes (see <see cref="CartesianAxis"/>). Ticks-subconfig of <see cref="CartesianAxis"/>. | ||
/// As per documentation here https://www.chartjs.org/docs/latest/axes/cartesian/#tick-configuration | ||
/// </summary> | ||
public abstract class CartesianTicks | ||
public abstract class CartesianTicks : Ticks | ||
{ | ||
/// <summary> | ||
/// Gets or sets the user defined minimum number for the scale, overrides minimum value from data. | ||
/// </summary> | ||
public double? Min { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the user defined maximum number for the scale, overrides maximum value from data. | ||
/// </summary> | ||
public double? Max { get; set; } | ||
|
||
/// <summary> | ||
/// The number of ticks to examine when deciding how many labels will fit. | ||
/// Setting a smaller value will be faster, but may be less accurate when there is large variability in label length. | ||
/// </summary> | ||
public int? SampleSize { get; set; } | ||
|
||
/// <summary> | ||
/// If true, automatically calculates how many labels can be shown and hides labels accordingly. | ||
/// Labels will be rotated up to maxRotation before skipping any. Turn autoSkip off to show all labels no matter what. | ||
/// Labels will be rotated up to maxRotation before skipping any. Turn <see cref="AutoSkip" /> off to show all labels no matter what. | ||
/// </summary> | ||
public bool AutoSkip { get; set; } = true; | ||
|
||
/// <summary> | ||
/// Padding between the ticks on the horizontal axis when <see cref="AutoSkip"></see> is enabled. | ||
/// Gets or sets the padding between the ticks on the horizontal axis when <see cref="AutoSkip" /> is enabled. | ||
/// </summary> | ||
public int AutoSkipPadding { get; set; } | ||
|
||
/// <summary> | ||
/// Distance in pixels to offset the label from the centre point of the tick (in the x direction for the x axis, and the y direction for the y axis). | ||
/// Gets or sets the distance in pixels to offset the label from the centre point of the tick (in the x direction for the x axis, and the y direction for the y axis). | ||
/// <para>Note: this can cause labels at the edges to be cropped by the edge of the canvas.</para> | ||
/// </summary> | ||
public int LabelOffset { get; set; } | ||
|
||
/// <summary> | ||
/// Maximum rotation for tick labels when rotating to condense labels. | ||
/// Gets or sets the maximum rotation for tick labels when rotating to condense labels. | ||
/// <para>Note: Rotation doesn't occur until necessary.</para> | ||
/// <para>Note: Only applicable to horizontal scales.</para> | ||
/// </summary> | ||
public int? MaxRotation { get; set; } | ||
|
||
/// <summary> | ||
/// Minimum rotation for tick labels. | ||
/// Gets or sets the minimum rotation for tick labels. | ||
/// <para>Note: Only applicable to horizontal scales.</para> | ||
/// </summary> | ||
public int? MinRotation { get; set; } | ||
|
||
/// <summary> | ||
/// Flips tick labels around axis, displaying the labels inside the chart instead of outside. | ||
/// If true, flips tick labels around axis, displaying the labels inside the chart instead of outside. | ||
/// <para>Note: Only applicable to vertical scales.</para> | ||
/// </summary> | ||
public bool? Mirror { get; set; } | ||
|
||
/// <summary> | ||
/// Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. | ||
/// When set on a horizontal axis, this applies in the vertical (Y) direction. | ||
/// </summary> | ||
public int Padding { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 4 additions & 9 deletions
13
src/ChartJs.Blazor/ChartJS/Common/Axes/Ticks/LogarithmicTicks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
| ||
namespace ChartJs.Blazor.ChartJS.Common.Axes.Ticks | ||
{ | ||
/// <summary> | ||
/// The ticks-subconfig of <see cref="LogarithmicAxis"/>. It has the same members as <see cref="CartesianTicks"/>. | ||
/// https://www.chartjs.org/docs/latest/axes/cartesian/logarithmic.html#tick-configuration-options | ||
/// </summary> | ||
public class LogarithmicTicks : CartesianTicks | ||
{ | ||
/// <summary> | ||
/// User defined minimum number for the scale, overrides minimum value from data. | ||
/// </summary> | ||
public int Min { get; set; } | ||
|
||
/// <summary> | ||
/// User defined maximum number for the scale, overrides maximum value from data. | ||
/// </summary> | ||
public int Max { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.