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
1 change: 0 additions & 1 deletion BlazorExpress.ChartJS.Demo.RCL/Layout/MainLayout.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public partial class MainLayout : MainLayoutBase
#region Fields and Constants

private bool isSidebarVisible = false;
//private HashSet<LinkGroup> linkGroups = new();
private Menu menuRef = default!;

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
<li><a href="/">Home</a></li>
<li><a href="@DemoRouteConstants.Docs_Getting_Started_Introduction">Docs</a></li>
<li><a href="@DemoRouteConstants.Demos_BarChart">Demos</a></li>
<li><a href="/">Blog</a></li>
@* <li><a href="/">Blog</a></li> *@
<li><a href="@GithubUrl" target="_blank">GitHub</a></li>
</ul>
</div>
<div class="column">
<p class="is-size-5">Guides</p>
<ul class="menu-list">
<li><a href="@DemoRouteConstants.Docs_Getting_Started_Introduction">Getting started</a></li>
<li><a href="/">Install NuGet package</a></li>
<li><a href="/">Starter templates</a></li>
@* <li><a href="/">Install NuGet package</a></li> *@
@* <li><a href="/">Starter templates</a></li> *@
</ul>
</div>
<div class="column">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@

<Image Src="@DemoImageSrcConstants.BarChart" class="img-fluid" alt="Blazor Bar Chart - API Documentation" />

<DemoLink Href="@DemoRouteConstants.Demos_BarChart" />
<DemoLink Href="@DemoRouteConstants.Demos_BubbleChart" />

<Section Class="p-0" Size="HeadingSize.H4" Name="Parameters" PageUrl="@pageUrl" Link="parameters">
<DocxTable TItem="BarChart" DocType="DocType.Parameters" />
<DocxTable TItem="BubbleChart" DocType="DocType.Parameters" />
</Section>

<Section Class="p-0" Size="HeadingSize.H4" Name="Methods" PageUrl="@pageUrl" Link="methods">
<DocxTable TItem="BarChart" DocType="DocType.Methods" />
<DocxTable TItem="BubbleChart" DocType="DocType.Methods" />
</Section>

<Section Class="p-0" Size="HeadingSize.H4" Name="ChartData Properties" PageUrl="@pageUrl" Link="chart-data-properties">
<DocxTable TItem="ChartData" DocType="DocType.Properties" />
</Section>

<Section Class="p-0" Size="HeadingSize.H4" Name="BarChartDataset Properties" PageUrl="@pageUrl" Link="barchart-dataset-properties">
<DocxTable TItem="BarChartDataset" DocType="DocType.Properties" />
<Section Class="p-0" Size="HeadingSize.H4" Name="BubbleChartDataset Properties" PageUrl="@pageUrl" Link="bubblechart-dataset-properties">
<DocxTable TItem="BubbleChartDataset" DocType="DocType.Properties" />
</Section>

<Section Class="p-0" Size="HeadingSize.H4" Name="BarChartDatasetData Properties" PageUrl="@pageUrl" Link="barchart-dataset-data-properties">
<DocxTable TItem="BarChartDatasetData" DocType="DocType.Properties" />
<Section Class="p-0" Size="HeadingSize.H4" Name="BubbleChartDatasetData Properties" PageUrl="@pageUrl" Link="bubblechart-dataset-data-properties">
<DocxTable TItem="BubbleChartDatasetData" DocType="DocType.Properties" />
</Section>

<Section Class="p-0" Size="HeadingSize.H4" Name="BarChartDatasetDataLabels Properties" PageUrl="@pageUrl" Link="barchart-dataset-data-labels-properties">
<DocxTable TItem="BarChartDatasetDataLabels" DocType="DocType.Properties" />
<Section Class="p-0" Size="HeadingSize.H4" Name="BubbleChartDatasetDataLabels Properties" PageUrl="@pageUrl" Link="bubblechart-dataset-data-labels-properties">
<DocxTable TItem="BubbleChartDatasetDataLabels" DocType="DocType.Properties" />
</Section>

<Section Class="p-0" Size="HeadingSize.H4" Name="BarChartOptions Properties" PageUrl="@pageUrl" Link="barchart-options-properties">
<DocxTable TItem="BarChartOptions" DocType="DocType.Properties" />
<Section Class="p-0" Size="HeadingSize.H4" Name="BubbleChartOptions Properties" PageUrl="@pageUrl" Link="bubblechart-options-properties">
<DocxTable TItem="BubbleChartOptions" DocType="DocType.Properties" />
</Section>

@code {
Expand Down
2 changes: 1 addition & 1 deletion BlazorExpress.ChartJS.Demo.RCL/Utils/DemoPageLinkUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static HashSet<PageLink> GetDemosLinks()
links.Add(new PageLink { Id = index, IconName = BootstrapIconName.BarChartFill, Href = DemoRouteConstants.Demos_BarChart, Text = "Bar Chart", Categories = new() { DemoPageLinkCategory.All, DemoPageLinkCategory.Charts }, Status = PageLinkStatus.None, IsActive = true });

index += 1;
links.Add(new PageLink { Id = index, IconName = BootstrapIconName.Diagram3Fill, Href = DemoRouteConstants.Demos_BubbleChart, Text = "Bubble Chart", Categories = new() { DemoPageLinkCategory.All, DemoPageLinkCategory.Charts }, Status = PageLinkStatus.New, IsActive = true });
links.Add(new PageLink { Id = index, IconName = BootstrapIconName.ThreeDotsVertical, Href = DemoRouteConstants.Demos_BubbleChart, Text = "Bubble Chart", Categories = new() { DemoPageLinkCategory.All, DemoPageLinkCategory.Charts }, Status = PageLinkStatus.New, IsActive = true });

index += 1;
links.Add(new PageLink { Id = index, IconName = BootstrapIconName.CircleFill, Href = DemoRouteConstants.Demos_DoughnutChart, Text = "Doughnut Chart", Categories = new() { DemoPageLinkCategory.All, DemoPageLinkCategory.Charts }, Status = PageLinkStatus.None, IsActive = true });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.0.0",
"version": "1.1.0",
"release": {
"short_description": "Bar, Doughnut, Line and Pie chart components!!!"
"short_description": "Introduces Bubble Chart support and various enhancements."
},
"NugetPackageName": "BlazorExpress.ChartJS",
"NugetPackageDisplayName": "BlazorExpress ChartJS",
Expand Down
4 changes: 2 additions & 2 deletions BlazorExpress.ChartJS/BlazorExpress.ChartJS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>

<PackageId>BlazorExpress.ChartJS</PackageId>
<Version>1.0.0</Version>
<PackageVersion>1.0.0</PackageVersion>
<Version>1.1.0</Version>
<PackageVersion>1.1.0</PackageVersion>

<PackageIcon>logo.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ public abstract class ChartComponentBase : BlazorExpressComponentCore, IDisposab

internal ChartType _chartType;

private bool isAsyncDisposed;

private bool isDisposed;

#endregion

#region Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 'rgba(0, 0, 0, 0.1)'.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue("rgba(0, 0, 0, 0.1)")]
[Description("The line fill color.")]
[ParameterTypeName("List<string>?")]
Expand All @@ -31,7 +31,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 'rgba(0, 0, 0, 0.1)'.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue("rgba(0, 0, 0, 0.1)")]
[Description("The line color.")]
[ParameterTypeName("List<string>?")]
Expand All @@ -44,7 +44,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 3.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(3)]
[Description("The line width (in pixels).")]
public double BorderWidth { get; set; } = 3;
Expand All @@ -60,7 +60,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// </para>
/// <see href="https://chartjs-plugin-datalabels.netlify.app/guide/getting-started.html#configuration" />
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue("new()")]
[Description("Gets or sets the data labels configuration for the bubble chart dataset. Use this property to customize the display of data labels, such as their position, formatting, and visibility, for the dataset in the bubble chart.")]
[ParameterTypeName(nameof(BubbleChartDatasetDataLabels))]
Expand All @@ -73,7 +73,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is <see langword="true"/>.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(true)]
[Description("Draw the active points of a dataset over the other points of the dataset.")]
[ParameterTypeName("List<bool>?")]
Expand All @@ -86,7 +86,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is <see langword="null"/>.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(null)]
[Description("The line fill color when hovered.")]
[ParameterTypeName("List<string>?")]
Expand All @@ -99,7 +99,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is <see langword="null"/>.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(null)]
[Description("The line color when hovered.")]
[ParameterTypeName("List<string>?")]
Expand All @@ -112,7 +112,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 1.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(1)]
[Description("The line width (in pixels) when hovered.")]
[ParameterTypeName("List<double>?")]
Expand All @@ -125,7 +125,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 1.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(1)]
[Description("The pixel size of the non-displayed point that reacts to mouse events.")]
[ParameterTypeName("List<double>?")]
Expand All @@ -138,7 +138,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 4.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(4)]
[Description("The pixel size of the non-displayed point that reacts to mouse events.")]
[ParameterTypeName("List<double>?")]
Expand All @@ -154,7 +154,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 3.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(3)]
[Description("The radius of the point shape. If set to 0, the point is not rendered.")]
[ParameterTypeName("List<double>?")]
Expand All @@ -167,7 +167,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// Default value is 0.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue(0)]
[Description("The rotation of the point in degrees.")]
[ParameterTypeName("List<double>?")]
Expand All @@ -182,7 +182,7 @@ public class BubbleChartDataset : ChartDataset<BubbleChartDataPoint>
/// </para>
/// <see href="https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles" />
/// </summary>
[AddedVersion("1.0.0")]
[AddedVersion("1.1.0")]
[DefaultValue("circle")]
[Description("Style of the point. Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle'.")]
[ParameterTypeName("List<string>?")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public LineChartDataset FillToDataset(ChartData chartData, IChartDataset dataset

if (relativeIndex)
{
var myIndex = relativeIndex ? chartData.Datasets.IndexOf(this) : 0;
if (chartData?.Datasets == null)
throw new ArgumentException("The chart data or its datasets collection is null.");

var myIndex = chartData.Datasets.IndexOf(this);

if (myIndex < 0)
throw new ArgumentException("The dataset is not in the chart data.");
Expand Down
75 changes: 1 addition & 74 deletions BlazorExpress.ChartJS/Models/ChartOptions/BubbleChartOptions.cs
Original file line number Diff line number Diff line change
@@ -1,76 +1,3 @@
namespace BlazorExpress.ChartJS;

public class BubbleChartOptions : ChartOptions
{
#region Properties, Indexers

//hover -> mode, intersect
//maintainAspectRatio
//plugins -> title -> display, text
/*
/// <summary>
/// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines.
/// </summary>
/// <remarks>
/// Default value is <see langword="null"/>.
/// </remarks>
[AddedVersion("1.0.0")]
[DefaultValue(null)]
[Description("The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines.")]
[ParameterTypeName("string?")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? IndexAxis { get; set; }

/// <summary>
/// Gets or sets the interaction options for the chart.
/// By default, these options apply to both the hover and tooltip interactions.
/// <para>
/// Default value is a new instance of <see cref="Interaction"/>.
/// </para>
/// <see href="https://www.chartjs.org/docs/latest/configuration/interactions.html#interactions" />
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue("new()")]
[Description("Gets or sets the interaction options for the chart.")]
public Interaction Interaction { get; set; } = new();

/// <summary>
/// Gets or sets the layout configuration for the chart.
/// <para>
/// Default value is a new instance of <see cref="ChartLayout"/>.
/// </para>
/// <see href="https://www.chartjs.org/docs/latest/configuration/layout.html#layout" />
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue("new()")]
[Description("Gets or sets the layout configuration for the chart.")]
[ParameterTypeName(nameof(ChartLayout))]
public ChartLayout Layout { get; set; } = new();

/// <summary>
/// Gets or sets the collection of plugins associated with the line chart.
/// <para>
/// Default value is a new instance of <see cref="LineChartPlugins"/>.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue("new()")]
[Description("Gets or sets the collection of plugins associated with the line chart.")]
[ParameterTypeName(nameof(LineChartPlugins))]
public LineChartPlugins Plugins { get; set; } = new();

/// <summary>
/// Gets or sets the collection of scales used for measurement or calibration.
/// <para>
/// Default value is a new instance of <see cref="Scales"/>.
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue("new()")]
[Description("Gets or sets the collection of scales used for measurement or calibration.")]
public Scales Scales { get; set; } = new();
*/
#endregion

//tooltips -> mode, intersect
}
public class BubbleChartOptions : ChartOptions { }
2 changes: 1 addition & 1 deletion BlazorExpress.ChartJS/Models/ChartOptions/ChartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void SetMode(InteractionMode interactionMode) =>
/// Sets which elements appear in the interaction.
/// </summary>
[JsonPropertyName("mode")]
public string ChartInteractionMode { get; private set; }
public string ChartInteractionMode { get; private set; } = string.Empty;

/// <summary>
/// if <see langword="true" />, the interaction mode only applies when the mouse position intersects an item on the chart.
Expand Down