first commit -push
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Dataset;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.BubbleChart;
|
||||
|
||||
public class BubbleChartDataset : ChartDataset<BubblePoint>
|
||||
{
|
||||
public bool DrawActiveElementsOnTop { get; set; } = true;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? HoverRadius { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? HitRadius { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? Radius { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Dataset;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.BubbleChart;
|
||||
|
||||
public class BubbleChartDatasetData(string? datasetLabel, BubblePoint data, string? backgroundColor) : ChartDatasetData(datasetLabel, data, backgroundColor)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using RobotNet.WebApp.Charts.Models.BarChart;
|
||||
using RobotNet.WebApp.Charts.Models.Common;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.BubbleChart;
|
||||
|
||||
public class BubbleChartOptions : ChartOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts.
|
||||
/// Supported values are 'x' and 'y'.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="null"/>.
|
||||
/// </remarks>
|
||||
public IndexAxis IndexAxis { get; set; } = IndexAxis.X;
|
||||
|
||||
public BubbleChartPlugins Plugins { get; set; } = new();
|
||||
|
||||
public BarScales Scales { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.BubbleChart;
|
||||
|
||||
public class BubbleChartPlugins : ChartPlugins
|
||||
{
|
||||
}
|
||||
26
RobotNet.WebApp/Charts/Models/BubbleChart/BubblePoint.cs
Normal file
26
RobotNet.WebApp/Charts/Models/BubbleChart/BubblePoint.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.BubbleChart;
|
||||
|
||||
public class BubblePoint(double x, double y, double r)
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the X-value of this <see cref="BubblePoint"/>.
|
||||
/// </summary>
|
||||
public double X { get; } = x;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Y-value of this <see cref="BubblePoint"/>.
|
||||
/// </summary>
|
||||
public double Y { get; } = y;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the radius of this <see cref="BubblePoint"/> in pixels. Will be serialized as 'r'.
|
||||
/// <para>
|
||||
/// Important: this property is not scaled by the chart,
|
||||
/// it is the raw radius in pixels of the bubble that is drawn on the canvas.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[JsonPropertyName("r")]
|
||||
public double Radius { get; } = r;
|
||||
}
|
||||
Reference in New Issue
Block a user