Skip to content

Commit

Permalink
Removed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joadan committed Mar 4, 2024
1 parent 4988243 commit 7fb78da
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 49 deletions.
51 changes: 2 additions & 49 deletions src/Blazor-ApexCharts/Models/ApexChartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public class Label
public Style Style { get; set; }

/// <summary>
/// Text for tha annotation label (single string or List<string> to put a multine label
/// Text for tha annotation label (single string or List of string) to put a multine label
/// </summary>
public LabelText Text { get; set; }

Expand Down Expand Up @@ -531,54 +531,7 @@ internal void SetEventFunction(AnnotationEventType eventType)
}
}

/// <remarks>
/// Accepts either a single value or collection of values.
/// By providing a collection in the case of chart annotations, the supplied strings will be printed as separate lines, thus allowing for multiline annotation handling.<br /><br />
///
/// Example:<br /><br />
///
/// <code>
/// // Single text
/// options.Annotations[0].Xaxis.Label.Text = "TextAnnotations";
///
/// // Multiple texts
/// Annotations = new Annotations {
/// Xaxis = new List<AnnotationsXAxis> {
/// new AnnotationsXAxis {
/// Label = new Label {
/// Text = new LabelText("Annotation Text")
/// }
/// }
/// }
/// </code>
/// </remarks>
public class LabelText : ValueOrList<string>
{
/// <summary>
/// Converts a label text collection into a list of strings
/// </summary>
public static implicit operator List<string>(LabelText source) => source.values;

/// <summary>
/// Converts a list of strings into an label text collection
/// </summary>
public static implicit operator LabelText(List<string> source) => new(source);

/// <summary>
/// Converts a string into an label text collection
/// </summary>
public static implicit operator LabelText(string source) => new(source);

/// <summary>
/// Creates a new collection of label texts with the provided values
/// </summary>
public LabelText(params string[] values) : base(values) { }

/// <summary>
/// Creates a new collection of label texts with the provided values
/// </summary>
public LabelText(IEnumerable<string> values) : base(values) { }
}



/// <summary>
Expand Down
53 changes: 53 additions & 0 deletions src/Blazor-ApexCharts/Models/MultiType/LabelText.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Collections.Generic;

namespace ApexCharts
{
/// <remarks>
/// Accepts either a single value or collection of values.
/// By providing a collection in the case of chart annotations, the supplied strings will be printed as separate lines, thus allowing for multiline annotation handling.<br /><br />
///
/// Example:<br /><br />
///
/// <code>
/// // Single text
/// options.Annotations[0].Xaxis.Label.Text = "TextAnnotations";
///
/// // Multiple texts
/// Annotations = new Annotations {
/// Xaxis = new List&lt;AnnotationsXAxis&gt; {
/// new AnnotationsXAxis {
/// Label = new Label {
/// Text = new LabelText("Annotation Text")
/// }
/// }
/// }
/// </code>
/// </remarks>
public class LabelText : ValueOrList<string>
{
/// <summary>
/// Converts a label text collection into a list of strings
/// </summary>
public static implicit operator List<string>(LabelText source) => source.values;

/// <summary>
/// Converts a list of strings into an label text collection
/// </summary>
public static implicit operator LabelText(List<string> source) => new(source);

/// <summary>
/// Converts a string into an label text collection
/// </summary>
public static implicit operator LabelText(string source) => new(source);

/// <summary>
/// Creates a new collection of label texts with the provided values
/// </summary>
public LabelText(params string[] values) : base(values) { }

/// <summary>
/// Creates a new collection of label texts with the provided values
/// </summary>
public LabelText(IEnumerable<string> values) : base(values) { }
}
}

0 comments on commit 7fb78da

Please sign in to comment.