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

Remove redundant abstraction of List to IList in BitChart (#8624) #8625

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class BitChartBarScales
/// <para>You can use any <see cref="BitChartCartesianAxis"/> but there are extended axes in the <see cref="BarChart.Axes"/> namespace which contain additional properties to customize the bar chart axes.</para>
/// </summary>
[JsonProperty("xAxes")]
public IList<BitChartCartesianAxis> XAxes { get; set; }
public List<BitChartCartesianAxis> XAxes { get; set; }

/// <summary>
/// Gets or sets the configurations for the y-axes.
/// <para>You can use any <see cref="BitChartCartesianAxis"/> but there are extended axes in the <see cref="BarChart.Axes"/> namespace which contain additional properties to customize the bar chart axes.</para>
/// </summary>
[JsonProperty("yAxes")]
public IList<BitChartCartesianAxis> YAxes { get; set; }
public List<BitChartCartesianAxis> YAxes { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class BitChartCategoryTicks : BitChartCartesianTicks
/// <summary>
/// Gets or sets an array of labels to display.
/// </summary>
public IList<string> Labels { get; set; }
public List<string> Labels { get; set; }

/// <summary>
/// Gets or sets the minimum item to display. The item has to be present in <see cref="Labels"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public BitChartChartData()
/// <see cref="Enums.AxisType.Category"/> for the chart to work correctly.
/// </para>
/// </summary>
public virtual IList<string> Labels { get; }
public virtual List<string> Labels { get; }

/// <summary>
/// Gets the labels the horizontal axes will use.
Expand All @@ -32,7 +32,7 @@ public BitChartChartData()
/// <see cref="Enums.AxisType.Category"/> for the chart to work correctly.
/// </para>
/// </summary>
public virtual IList<string> XLabels { get; }
public virtual List<string> XLabels { get; }

/// <summary>
/// Gets the labels the vertical axes will use.
Expand All @@ -41,12 +41,12 @@ public BitChartChartData()
/// <see cref="Enums.AxisType.Category"/> for the chart to work correctly.
/// </para>
/// </summary>
public virtual IList<string> YLabels { get; }
public virtual List<string> YLabels { get; }

/// <summary>
/// Gets the datasets displayed in this chart.
/// </summary>
public IList<IBitChartDataset> Datasets { get; }
public List<IBitChartDataset> Datasets { get; }

[Obsolete("json.net", true)]
public bool ShouldSerializeLabels() => Labels?.Count > 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected BitChartConfigBase(BitChartChartType chartType)
/// <see cref="BitChartBaseConfigOptions.Plugins"/> instead.
/// </para>
/// </summary>
public IList<object> Plugins { get; } = new List<object>();
public List<object> Plugins { get; } = new List<object>();

/// <summary>
/// This method tells json.net to only serialize the plugins when there
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class BitChartDelegateHandler<T> : IBitChartMethodHandler<T>, IDis
private static readonly bool _delegateHasReturnValue;

private readonly T _function;
private readonly IList<int> _ignoredIndices;
private readonly List<int> _ignoredIndices;

/// <summary>
/// Gets the name of the method which should be called from JavaScript.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class BitChartScales
/// Gets or sets the configurations for the x-axes.
/// </summary>
[JsonProperty("xAxes")]
public IList<BitChartCartesianAxis> XAxes { get; set; }
public List<BitChartCartesianAxis> XAxes { get; set; }

/// <summary>
/// Gets or sets the configurations for the y-axes.
/// </summary>
[JsonProperty("yAxes")]
public IList<BitChartCartesianAxis> YAxes { get; set; }
public List<BitChartCartesianAxis> YAxes { get; set; }
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ private void RandomizeData()
{
int count = intDataset.Count;
intDataset.Clear();
intDataset.AddRange(BitChartDemoUtils.RandomScalingFactor(count));
foreach (var factor in BitChartDemoUtils.RandomScalingFactor(count))
{
intDataset.Add(factor);
}
}
}

Expand Down Expand Up @@ -329,7 +332,10 @@ private void RandomizeData()
{
int count = intDataset.Count;
intDataset.Clear();
intDataset.AddRange(BitChartDemoUtils.RandomScalingFactor(count));
foreach (var factor in BitChartDemoUtils.RandomScalingFactor(count))
{
intDataset.Add(factor);
}
}
}

Expand Down
Loading