From 80ce21705c58c76812d3adab4100dd29a700e8f3 Mon Sep 17 00:00:00 2001 From: HansM Date: Sat, 14 Sep 2019 15:58:46 +0200 Subject: [PATCH] Code style and spelling fixes, updated index page. (#81) * Code style and spelling fixes, updated index page. * Adjusted namespaces in ColorUtil. * Fixed brackets in WeatherForecastService. * Fixed more spelling issues. --- ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs | 2 +- ChartJs.Blazor/ChartJS/BarChart/BarData.cs | 1 - .../ChartJS/BarChart/Dataset/BarDataset.cs | 4 +- .../BarChart/Dataset/BaseBarDataset.cs | 4 +- .../BarChart/Dataset/IndividualBarDataset.cs | 5 +- .../ChartJS/BubbleChart/BubbleData.cs | 1 - .../ChartJS/BubbleChart/BubbleDataset.cs | 4 +- ChartJs.Blazor/ChartJS/ChartJsInterop.cs | 2 - ChartJs.Blazor/ChartJS/Common/ConfigBase.cs | 3 +- .../ChartJS/Common/Enums/AxisDisplay.cs | 4 +- .../ChartJS/Common/Enums/SteppedLine.cs | 4 +- .../ChartJS/Common/Enums/TimeDistribution.cs | 5 +- ChartJs.Blazor/ChartJS/Common/GridLines.cs | 2 +- .../ChartJS/Common/IndexableOption.cs | 3 +- .../Common/IndexableOptionConverter.cs | 2 - .../ChartJS/Common/JsonWriteOnlyConverter.cs | 8 +- .../ChartJS/Common/Legends/Labels.cs | 2 +- ChartJs.Blazor/ChartJS/Common/SubTicks.cs | 3 +- ChartJs.Blazor/ChartJS/Common/Ticks.cs | 2 +- .../ChartJS/Common/Wrappers/FloatWrapper.cs | 1 - .../Wrappers/JsonValueWrapperConverter.cs | 8 +- .../ChartJS/Common/Wrappers/ValueWrapper.cs | 3 +- .../Common/Wrappers/WrapperExtensions.cs | 14 +- .../ChartJS/LineChart/Axes/CategoryAxis.cs | 5 +- .../LineChart/Axes/LinearCartesianAxis.cs | 3 - .../LineChart/Axes/Ticks/CategoryTicks.cs | 5 +- .../Axes/Ticks/LinearCartesianTicks.cs | 6 +- .../LineChart/Axes/Ticks/LogarithmicTicks.cs | 5 +- .../ChartJS/LineChart/Axes/Ticks/TimeTicks.cs | 6 +- .../ChartJS/LineChart/Axes/TimeAxis.cs | 3 - .../ChartJS/LineChart/JsonMomentConverter.cs | 4 - ChartJs.Blazor/ChartJS/LineChart/LineData.cs | 1 - .../ChartJS/LineChart/LineDataset.cs | 8 +- .../ChartJS/LineChart/LineOptions.cs | 2 +- .../ChartJS/LineChart/LineOptionsHover.cs | 3 +- ChartJs.Blazor/ChartJS/LineChart/Moment.cs | 4 +- .../ChartJS/LineChart/ScaleLabel.cs | 6 +- .../ChartJS/LineChart/TimeDisplayFormats.cs | 6 +- .../ChartJS/LineChart/TimeOptions.cs | 4 +- .../LineChart/{TimeTupel.cs => TimeTuple.cs} | 13 +- .../ChartJS/MixedChart/BaseMixableDataset.cs | 2 +- .../ChartJS/MixedChart/MixedOptions.cs | 1 - ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs | 2 +- .../ChartJS/PolarAreaChart/Axis/AngleLines.cs | 2 +- .../PolarAreaChart/Axis/LinearRadialAxis.cs | 2 +- .../PolarAreaChart/Axis/LinearRadialTicks .cs | 2 +- .../PolarAreaChart/Axis/PointLabels.cs | 3 +- .../PolarAreaChart/PolarAreaDataset.cs | 9 +- .../ChartJS/RadarChart/RadarDataset.cs | 3 +- ChartJs.Blazor/ChartJS/RadarChart/Scale.cs | 3 +- .../ChartJS/ScatterChart/ScatterDataset.cs | 6 +- ChartJs.Blazor/ChartJs.Blazor.xml | 184 +++++++++--------- ChartJs.Blazor/Util/{Color => }/ColorUtil.cs | 2 +- DynamicCharts.sln.DotSettings | 19 ++ WebCore/Data/WeatherForecastService.cs | 4 +- WebCore/Pages/DoughnutExample.razor | 2 +- WebCore/Pages/Index.razor | 18 +- WebCore/Pages/LineLinearExample.razor | 9 +- WebCore/Pages/LineLogarithmicExample.razor | 13 +- WebCore/Pages/LineTimeExample.razor | 5 +- WebCore/Pages/PieExample.razor | 1 - WebCore/Pages/SimpleLineLinearExample.razor | 5 +- WebCore/Pages/_Host.cshtml | 4 +- WebCore/Program.cs | 8 - WebCore/Shared/MainLayout.razor | 2 +- 65 files changed, 213 insertions(+), 269 deletions(-) rename ChartJs.Blazor/ChartJS/LineChart/{TimeTupel.cs => TimeTuple.cs} (75%) rename ChartJs.Blazor/Util/{Color => }/ColorUtil.cs (98%) create mode 100644 DynamicCharts.sln.DotSettings diff --git a/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs b/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs index 1403290..d062548 100644 --- a/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs +++ b/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs @@ -4,7 +4,7 @@ namespace ChartJs.Blazor.ChartJS.BarChart { /// - /// Config for a bar chart with typesafe data + /// Config for a bar chart with type safe data /// Either 'bar' or 'horizontalBar' /// public class BarConfig : ConfigBase diff --git a/ChartJs.Blazor/ChartJS/BarChart/BarData.cs b/ChartJs.Blazor/ChartJS/BarChart/BarData.cs index 09a712e..4dc22d9 100644 --- a/ChartJs.Blazor/ChartJS/BarChart/BarData.cs +++ b/ChartJs.Blazor/ChartJS/BarChart/BarData.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using ChartJs.Blazor.ChartJS.BarChart.Dataset; using ChartJs.Blazor.ChartJS.MixedChart; namespace ChartJs.Blazor.ChartJS.BarChart diff --git a/ChartJs.Blazor/ChartJS/BarChart/Dataset/BarDataset.cs b/ChartJs.Blazor/ChartJS/BarChart/Dataset/BarDataset.cs index e3253aa..7f1089a 100644 --- a/ChartJs.Blazor/ChartJS/BarChart/Dataset/BarDataset.cs +++ b/ChartJs.Blazor/ChartJS/BarChart/Dataset/BarDataset.cs @@ -1,9 +1,9 @@ -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.BarChart.Dataset { /// - /// Dataset for Bar Chart with typesafe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties + /// Dataset for a bar chart with type safe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties /// /// Defines the type of data in this dataset. Use Wrappers from for value types. public class BarDataset : BaseBarDataset where TData : class diff --git a/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs b/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs index 7673c89..8fe5e51 100644 --- a/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs +++ b/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using ChartJs.Blazor.ChartJS.Common.Enums; using ChartJs.Blazor.ChartJS.MixedChart; using Newtonsoft.Json; @@ -8,7 +7,7 @@ namespace ChartJs.Blazor.ChartJS.BarChart.Dataset { /// - /// A base dataset for a barchart + /// A base dataset for a bar chart. /// /// Defines the type of data in this dataset. Use Wrappers from for value types. public class BaseBarDataset : BaseMixableDataset where TData : class @@ -47,7 +46,6 @@ public BaseBarDataset() { } /// /// The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack) - /// /// /// Specific for stacked bar charts /// diff --git a/ChartJs.Blazor/ChartJS/BarChart/Dataset/IndividualBarDataset.cs b/ChartJs.Blazor/ChartJS/BarChart/Dataset/IndividualBarDataset.cs index 3392896..e166274 100644 --- a/ChartJs.Blazor/ChartJS/BarChart/Dataset/IndividualBarDataset.cs +++ b/ChartJs.Blazor/ChartJS/BarChart/Dataset/IndividualBarDataset.cs @@ -1,11 +1,10 @@ using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.BarChart.Dataset { /// - /// Dataset for Bar Chart with typesafe Data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties - /// + /// Dataset for a bar chart with type safe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties /// /// The first value applies to the first bar, the second value to the second bar, and so on. /// diff --git a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleData.cs b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleData.cs index 9408961..b7c55d2 100644 --- a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleData.cs +++ b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleData.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using ChartJs.Blazor.ChartJS.Common; using ChartJs.Blazor.ChartJS.Common.Properties; namespace ChartJs.Blazor.ChartJS.BubbleChart diff --git a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs index 91bc42d..bd1aa06 100644 --- a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs +++ b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs @@ -1,6 +1,6 @@ -using ChartJs.Blazor.Util.Color; -using System.Collections.Generic; +using System.Collections.Generic; using ChartJs.Blazor.ChartJS.Common.Enums; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.BubbleChart { diff --git a/ChartJs.Blazor/ChartJS/ChartJsInterop.cs b/ChartJs.Blazor/ChartJS/ChartJsInterop.cs index 12d12a5..6714756 100644 --- a/ChartJs.Blazor/ChartJS/ChartJsInterop.cs +++ b/ChartJs.Blazor/ChartJS/ChartJsInterop.cs @@ -91,9 +91,7 @@ public static ValueTask UpdateChart(this IJSRuntime jsRuntime, ConfigBase /// /// Returns an object that is equivalent to the given parameter but without any null member AND it preserves DotNetInstanceClickHandler/DotNetInstanceHoverHandler members intact - /// /// Preserving DotNetInstanceClick/HoverHandler members is important because they contain DotNetObjectRefs to the instance whose method should be invoked on click/hover - /// /// This whole method is hacky af but necessary. Stripping null members is only needed because the default config for the Line charts on the Blazor side is somehow messed up. If this were not the case no null member stripping were necessary and hence, the recovery of the DotNetObjectRef members would also not be needed. Nevertheless, The Show must go on! /// /// diff --git a/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs b/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs index 492f8dc..851b26f 100644 --- a/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs +++ b/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs @@ -1,5 +1,4 @@ using ChartJs.Blazor.ChartJS.Common.Enums; -using Newtonsoft.Json; using System; namespace ChartJs.Blazor.ChartJS.Common @@ -31,7 +30,7 @@ protected ConfigBase(ChartTypes chartType) } /// - /// Base class for chart-config which contains the options and the data subconfigs + /// Base class for chart-config which contains the options and the data sub-configs /// /// The type of the options-subconfig /// The type of the data-subconfig diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs b/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs index 876c16c..f49e612 100644 --- a/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs +++ b/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs @@ -1,6 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter; -using Newtonsoft.Json; - + namespace ChartJs.Blazor.ChartJS.Common.Enums { /// diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs b/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs index 2bd70f0..3b166c6 100644 --- a/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs +++ b/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs @@ -1,6 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter; -using Newtonsoft.Json; - + namespace ChartJs.Blazor.ChartJS.Common.Enums { /// diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/TimeDistribution.cs b/ChartJs.Blazor/ChartJS/Common/Enums/TimeDistribution.cs index 24f2088..044417f 100644 --- a/ChartJs.Blazor/ChartJS/Common/Enums/TimeDistribution.cs +++ b/ChartJs.Blazor/ChartJS/Common/Enums/TimeDistribution.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - + namespace ChartJs.Blazor.ChartJS.Common.Enums { /// diff --git a/ChartJs.Blazor/ChartJS/Common/GridLines.cs b/ChartJs.Blazor/ChartJS/Common/GridLines.cs index 98cc91f..785783f 100644 --- a/ChartJs.Blazor/ChartJS/Common/GridLines.cs +++ b/ChartJs.Blazor/ChartJS/Common/GridLines.cs @@ -1,4 +1,4 @@ -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.Common { diff --git a/ChartJs.Blazor/ChartJS/Common/IndexableOption.cs b/ChartJs.Blazor/ChartJS/Common/IndexableOption.cs index c872de8..12a0e9b 100644 --- a/ChartJs.Blazor/ChartJS/Common/IndexableOption.cs +++ b/ChartJs.Blazor/ChartJS/Common/IndexableOption.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; namespace ChartJs.Blazor.ChartJS.Common { /// - /// Represents an object that can be either a single value or an array of values. This is used for typesafe js-interop. + /// Represents an object that can be either a single value or an array of values. This is used for type safe js-interop. /// /// The type of data this is supposed to hold. [Newtonsoft.Json.JsonConverter(typeof(IndexableOptionConverter))] // newtonsoft for now diff --git a/ChartJs.Blazor/ChartJS/Common/IndexableOptionConverter.cs b/ChartJs.Blazor/ChartJS/Common/IndexableOptionConverter.cs index 7a17e8f..902a413 100644 --- a/ChartJs.Blazor/ChartJS/Common/IndexableOptionConverter.cs +++ b/ChartJs.Blazor/ChartJS/Common/IndexableOptionConverter.cs @@ -1,9 +1,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; -using System.Collections.Generic; using System.Reflection; -using System.Text; namespace ChartJs.Blazor.ChartJS.Common { diff --git a/ChartJs.Blazor/ChartJS/Common/JsonWriteOnlyConverter.cs b/ChartJs.Blazor/ChartJS/Common/JsonWriteOnlyConverter.cs index 95f90d2..157afc1 100644 --- a/ChartJs.Blazor/ChartJS/Common/JsonWriteOnlyConverter.cs +++ b/ChartJs.Blazor/ChartJS/Common/JsonWriteOnlyConverter.cs @@ -1,16 +1,14 @@ using Newtonsoft.Json; using System; -using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.Common { internal abstract class JsonWriteOnlyConverter : JsonConverter { - public sealed override bool CanRead => false; - public sealed override bool CanWrite => true; + public override sealed bool CanRead => false; + public override sealed bool CanWrite => true; - public sealed override T ReadJson(JsonReader reader, Type objectType, T existingValue, bool hasExistingValue, JsonSerializer serializer) + public override sealed T ReadJson(JsonReader reader, Type objectType, T existingValue, bool hasExistingValue, JsonSerializer serializer) { throw new NotImplementedException("Don't use me to read JSON"); } diff --git a/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs b/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs index ab1a991..d3b161a 100644 --- a/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs +++ b/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs @@ -1,4 +1,4 @@ -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.Common.Legends { diff --git a/ChartJs.Blazor/ChartJS/Common/SubTicks.cs b/ChartJs.Blazor/ChartJS/Common/SubTicks.cs index 9e5bbf3..99600fc 100644 --- a/ChartJs.Blazor/ChartJS/Common/SubTicks.cs +++ b/ChartJs.Blazor/ChartJS/Common/SubTicks.cs @@ -1,5 +1,4 @@ - -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.Common { diff --git a/ChartJs.Blazor/ChartJS/Common/Ticks.cs b/ChartJs.Blazor/ChartJS/Common/Ticks.cs index 86fc632..d9e7e19 100644 --- a/ChartJs.Blazor/ChartJS/Common/Ticks.cs +++ b/ChartJs.Blazor/ChartJS/Common/Ticks.cs @@ -1,4 +1,4 @@ -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.Common { diff --git a/ChartJs.Blazor/ChartJS/Common/Wrappers/FloatWrapper.cs b/ChartJs.Blazor/ChartJS/Common/Wrappers/FloatWrapper.cs index c8b9525..c822980 100644 --- a/ChartJs.Blazor/ChartJS/Common/Wrappers/FloatWrapper.cs +++ b/ChartJs.Blazor/ChartJS/Common/Wrappers/FloatWrapper.cs @@ -1,5 +1,4 @@ using Newtonsoft.Json; -using System; namespace ChartJs.Blazor.ChartJS.Common.Wrappers { diff --git a/ChartJs.Blazor/ChartJS/Common/Wrappers/JsonValueWrapperConverter.cs b/ChartJs.Blazor/ChartJS/Common/Wrappers/JsonValueWrapperConverter.cs index f8902c2..29010c5 100644 --- a/ChartJs.Blazor/ChartJS/Common/Wrappers/JsonValueWrapperConverter.cs +++ b/ChartJs.Blazor/ChartJS/Common/Wrappers/JsonValueWrapperConverter.cs @@ -1,10 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Text; +using Newtonsoft.Json; namespace ChartJs.Blazor.ChartJS.Common.Wrappers { diff --git a/ChartJs.Blazor/ChartJS/Common/Wrappers/ValueWrapper.cs b/ChartJs.Blazor/ChartJS/Common/Wrappers/ValueWrapper.cs index e674971..baa99e1 100644 --- a/ChartJs.Blazor/ChartJS/Common/Wrappers/ValueWrapper.cs +++ b/ChartJs.Blazor/ChartJS/Common/Wrappers/ValueWrapper.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json; - + namespace ChartJs.Blazor.ChartJS.Common.Wrappers { public abstract class ValueWrapper where TData : struct diff --git a/ChartJs.Blazor/ChartJS/Common/Wrappers/WrapperExtensions.cs b/ChartJs.Blazor/ChartJS/Common/Wrappers/WrapperExtensions.cs index e76f78a..1aebf89 100644 --- a/ChartJs.Blazor/ChartJS/Common/Wrappers/WrapperExtensions.cs +++ b/ChartJs.Blazor/ChartJS/Common/Wrappers/WrapperExtensions.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; namespace ChartJs.Blazor.ChartJS.Common.Wrappers { @@ -12,12 +10,12 @@ public static IEnumerable UnWrap(this IEnumerable> wrapper return wrappers.Select(v => v.Value); } - public static IEnumerable Wrap(this IEnumerable values) + public static IEnumerable Wrap(this IEnumerable values) { return values.Select(v => (ByteWrapper)v); } - public static IEnumerable Wrap(this IEnumerable values) + public static IEnumerable Wrap(this IEnumerable values) { return values.Select(v => (DoubleWrapper)v); } @@ -27,17 +25,17 @@ public static IEnumerable Wrap(this IEnumerable values) return values.Select(v => (FloatWrapper)v); } - public static IEnumerable Wrap(this IEnumerable values) + public static IEnumerable Wrap(this IEnumerable values) { return values.Select(v => (Int16Wrapper)v); } - public static IEnumerable Wrap(this IEnumerable values) + public static IEnumerable Wrap(this IEnumerable values) { return values.Select(v => (Int32Wrapper)v); } - public static IEnumerable Wrap(this IEnumerable values) + public static IEnumerable Wrap(this IEnumerable values) { return values.Select(v => (Int64Wrapper)v); } diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/CategoryAxis.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/CategoryAxis.cs index 8456b23..f593ed7 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/CategoryAxis.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/CategoryAxis.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using ChartJs.Blazor.ChartJS.Common.Enums; +using ChartJs.Blazor.ChartJS.Common.Enums; using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks; namespace ChartJs.Blazor.ChartJS.LineChart.Axes diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/LinearCartesianAxis.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/LinearCartesianAxis.cs index c17d9b0..a103ca0 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/LinearCartesianAxis.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/LinearCartesianAxis.cs @@ -1,8 +1,5 @@ using ChartJs.Blazor.ChartJS.Common.Enums; using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks; -using System; -using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.LineChart.Axes { diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/CategoryTicks.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/CategoryTicks.cs index f10c9a5..b2460e0 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/CategoryTicks.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/CategoryTicks.cs @@ -1,7 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks { diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LinearCartesianTicks.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LinearCartesianTicks.cs index 6a767b2..faef8c6 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LinearCartesianTicks.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LinearCartesianTicks.cs @@ -1,8 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common; -using System; -using System.Collections.Generic; -using System.Text; - + namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks { /// diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LogarithmicTicks.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LogarithmicTicks.cs index 70ff922..308c5ab 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LogarithmicTicks.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/LogarithmicTicks.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - + namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks { public class LogarithmicTicks : CartesianTicks diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/TimeTicks.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/TimeTicks.cs index 7fab98a..7ae28ac 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/TimeTicks.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/TimeTicks.cs @@ -1,8 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.ChartJS.Common.Enums; -using System; -using System.Collections.Generic; -using System.Text; +using ChartJs.Blazor.ChartJS.Common.Enums; namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks { diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs index 8ef1571..999df3f 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs @@ -1,8 +1,5 @@ using ChartJs.Blazor.ChartJS.Common.Enums; using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks; -using System; -using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.LineChart.Axes { diff --git a/ChartJs.Blazor/ChartJS/LineChart/JsonMomentConverter.cs b/ChartJs.Blazor/ChartJS/LineChart/JsonMomentConverter.cs index 609ffa1..96ab57b 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/JsonMomentConverter.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/JsonMomentConverter.cs @@ -1,9 +1,5 @@ using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.LineChart { diff --git a/ChartJs.Blazor/ChartJS/LineChart/LineData.cs b/ChartJs.Blazor/ChartJS/LineChart/LineData.cs index 75befee..02e6740 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/LineData.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/LineData.cs @@ -1,6 +1,5 @@ using ChartJs.Blazor.ChartJS.MixedChart; using Newtonsoft.Json; -using System; using System.Collections.Generic; namespace ChartJs.Blazor.ChartJS.LineChart diff --git a/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs b/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs index 1811b99..4d68fb9 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using ChartJs.Blazor.ChartJS.Common.Enums; using ChartJs.Blazor.ChartJS.MixedChart; -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.LineChart { @@ -73,7 +73,7 @@ public LineDataset() { } /// /// Length and spacing of dashes. It's an int array. Whatever JS! /// - public int[] BorderDash { get; set; } = new int[] {0, 0}; + public int[] BorderDash { get; set; } = { 0, 0 }; /// /// Offset for line dashes. @@ -111,13 +111,13 @@ public LineDataset() { } public bool Fill { get; set; } /// - /// Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used. + /// Bezier curve tension of the line. Set to 0 to draw straight lines. This option is ignored if monotone cubic interpolation is used. /// public double LineTension { get; set; } = 0.4; /// /// If false, the line is not drawn for this dataset. - /// Default is true. If you are filling and dont want to show the line, then change to false. + /// Default is true. If you are filling and don't want to show the line, then change to false. /// public bool ShowLine { get; set; } = true; diff --git a/ChartJs.Blazor/ChartJS/LineChart/LineOptions.cs b/ChartJs.Blazor/ChartJS/LineChart/LineOptions.cs index 14ceb8a..f7a7ecc 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/LineOptions.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/LineOptions.cs @@ -15,7 +15,7 @@ public class LineOptions : BaseConfigOptions public Animation Animation { get; set; } /// - /// Hover options for hoving over an item + /// Hover options for hovering over an item /// public LineOptionsHover Hover { get; set; } diff --git a/ChartJs.Blazor/ChartJS/LineChart/LineOptionsHover.cs b/ChartJs.Blazor/ChartJS/LineChart/LineOptionsHover.cs index d236524..68219a8 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/LineOptionsHover.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/LineOptionsHover.cs @@ -1,5 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common.Enums; -using ChartJs.Blazor.ChartJS.Common.Properties; +using ChartJs.Blazor.ChartJS.Common.Properties; namespace ChartJs.Blazor.ChartJS.LineChart { diff --git a/ChartJs.Blazor/ChartJS/LineChart/Moment.cs b/ChartJs.Blazor/ChartJS/LineChart/Moment.cs index 9837e70..360867c 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Moment.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Moment.cs @@ -1,7 +1,5 @@ using Newtonsoft.Json; using System; -using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.LineChart { @@ -10,7 +8,7 @@ namespace ChartJs.Blazor.ChartJS.LineChart /// // This wrapper can be removed if https://github.com/aspnet/AspNetCore/issues/12685 passes // because then we can just write a custom converter for DateTime and add that to - // the options so it's used for every DateTime it sees. This should not have sideeffects. + // the options so it's used for every DateTime it sees. This should not have side effects. [JsonConverter(typeof(JsonMomentConverter))] public class Moment { diff --git a/ChartJs.Blazor/ChartJS/LineChart/ScaleLabel.cs b/ChartJs.Blazor/ChartJS/LineChart/ScaleLabel.cs index fb230cf..385ffbd 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/ScaleLabel.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/ScaleLabel.cs @@ -1,5 +1,5 @@ -using ChartJs.Blazor.Util.Color; - +using ChartJs.Blazor.Util; + namespace ChartJs.Blazor.ChartJS.LineChart { /// @@ -27,7 +27,7 @@ public ScaleLabel(string labelString = null) public string LabelString { get; set; } /// - /// The fontcolor of the label + /// The font color of the label /// See for working with colors. /// public string FontColor { get; set; } diff --git a/ChartJs.Blazor/ChartJS/LineChart/TimeDisplayFormats.cs b/ChartJs.Blazor/ChartJS/LineChart/TimeDisplayFormats.cs index cd0a4aa..918f224 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/TimeDisplayFormats.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/TimeDisplayFormats.cs @@ -1,18 +1,16 @@ using ChartJs.Blazor.ChartJS.Common.Enums; -using System; using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.LineChart { /// - /// This is a helper class containing premade displayformats to use in for certain locales. + /// This is a helper class containing pre-made display formats to use in for certain locales. /// Those s that are not defined, will use the default format from https://www.chartjs.org/docs/latest/axes/cartesian/time.html#display-formats /// public static class TimeDisplayFormats { /// - /// Premade format-string for the swiss (DE_CH) locale. + /// Pre-made format-string for the swiss (DE_CH) locale. /// public static Dictionary DE_CH => new Dictionary { diff --git a/ChartJs.Blazor/ChartJS/LineChart/TimeOptions.cs b/ChartJs.Blazor/ChartJS/LineChart/TimeOptions.cs index 2308fba..25cabec 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/TimeOptions.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/TimeOptions.cs @@ -1,7 +1,5 @@ using ChartJs.Blazor.ChartJS.Common.Enums; -using System; using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.LineChart { @@ -12,7 +10,7 @@ public class TimeOptions { /// /// Sets how different time units are displayed. See https://www.chartjs.org/docs/latest/axes/cartesian/time.html#data-sets for more details. - /// See for premade formats for certain locales. + /// See for pre-made formats for certain locales. /// public Dictionary DisplayFormats { get; set; } diff --git a/ChartJs.Blazor/ChartJS/LineChart/TimeTupel.cs b/ChartJs.Blazor/ChartJS/LineChart/TimeTuple.cs similarity index 75% rename from ChartJs.Blazor/ChartJS/LineChart/TimeTupel.cs rename to ChartJs.Blazor/ChartJS/LineChart/TimeTuple.cs index 33aa435..46463c4 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/TimeTupel.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/TimeTuple.cs @@ -1,7 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace ChartJs.Blazor.ChartJS.LineChart { @@ -11,27 +8,27 @@ namespace ChartJs.Blazor.ChartJS.LineChart /// Reference Type so it can be used in the covariant /// /// - public class TimeTupel + public class TimeTuple { /// - /// Creates a new instance of + /// Creates a new instance of /// /// The instance to represent the x-value. /// The value of type which represents the y-value. - public TimeTupel(Moment time, TData yValue) + public TimeTuple(Moment time, TData yValue) { Time = time; YValue = yValue; } /// - /// The time-/x-value for this . + /// The time-/x-value for this . /// [JsonProperty("t")] public Moment Time { get; set; } /// - /// The y-value for this . + /// The y-value for this . /// [JsonProperty("y")] public TData YValue { get; set; } diff --git a/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs b/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs index 0496722..b1ea0ac 100644 --- a/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs +++ b/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs @@ -4,7 +4,7 @@ namespace ChartJs.Blazor.ChartJS.MixedChart { /// - /// The baseclass for a dataset that implements the covariant + /// The base class for a dataset that implements the covariant /// /// Defines the type of data in this dataset. Use Wrappers from for value types. public abstract class BaseMixableDataset : IMixableDataset diff --git a/ChartJs.Blazor/ChartJS/MixedChart/MixedOptions.cs b/ChartJs.Blazor/ChartJS/MixedChart/MixedOptions.cs index 6596476..6f2cfb7 100644 --- a/ChartJs.Blazor/ChartJS/MixedChart/MixedOptions.cs +++ b/ChartJs.Blazor/ChartJS/MixedChart/MixedOptions.cs @@ -4,6 +4,5 @@ namespace ChartJs.Blazor.ChartJS.MixedChart { public class MixedOptions : BaseConfigOptions { - } } \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs b/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs index fe4a74c..33c90df 100644 --- a/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs +++ b/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using ChartJs.Blazor.ChartJS.Common; using ChartJs.Blazor.ChartJS.Common.Enums; -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.PieChart { diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/AngleLines.cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/AngleLines.cs index 59c4245..4f24aca 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/AngleLines.cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/AngleLines.cs @@ -1,4 +1,4 @@ -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.PolarAreaChart.Axis { diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialAxis.cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialAxis.cs index 4e4abd2..be5b5d9 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialAxis.cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialAxis.cs @@ -3,7 +3,7 @@ namespace ChartJs.Blazor.ChartJS.PolarAreaChart.Axis { /// - /// A linear readial axis. + /// A linear radial axis. /// As per documentation here https://www.chartjs.org/docs/latest/axes/radial/linear.html. /// public class LinearRadialAxis diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialTicks .cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialTicks .cs index cc3ac08..257883e 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialTicks .cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/LinearRadialTicks .cs @@ -1,5 +1,5 @@ using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.PolarAreaChart.Axis { diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs index 6ba83fc..8983f66 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs @@ -1,6 +1,5 @@ using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.Util.Color; -using System.Collections.Generic; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.PolarAreaChart.Axis { diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs index 4ba27ae..2b287ef 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs @@ -1,7 +1,8 @@ -using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.ChartJS.Common.Enums; -using ChartJs.Blazor.Charts; -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.ChartJS.Common; +using ChartJs.Blazor.ChartJS.Common.Enums; +using ChartJs.Blazor.Charts; +using ChartJs.Blazor.Util; + using System.Collections.Generic; namespace ChartJs.Blazor.ChartJS.PolarAreaChart diff --git a/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs b/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs index acbaf80..03be712 100644 --- a/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs +++ b/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs @@ -1,6 +1,7 @@ using ChartJs.Blazor.ChartJS.Common; using ChartJs.Blazor.ChartJS.Common.Enums; -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; + using System.Collections.Generic; namespace ChartJs.Blazor.ChartJS.RadarChart diff --git a/ChartJs.Blazor/ChartJS/RadarChart/Scale.cs b/ChartJs.Blazor/ChartJS/RadarChart/Scale.cs index 5ddc841..0ae7ee8 100644 --- a/ChartJs.Blazor/ChartJS/RadarChart/Scale.cs +++ b/ChartJs.Blazor/ChartJS/RadarChart/Scale.cs @@ -1,5 +1,4 @@ -using ChartJs.Blazor.ChartJS.Common; -using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks; +using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks; namespace ChartJs.Blazor.ChartJS.RadarChart { diff --git a/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs b/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs index 948f1cf..d4e8166 100644 --- a/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs +++ b/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using ChartJs.Blazor.ChartJS.Common; using ChartJs.Blazor.ChartJS.Common.Enums; -using ChartJs.Blazor.Util.Color; +using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.ScatterChart { @@ -87,13 +87,13 @@ public class ScatterDataset public bool Fill { get; set; } /// - /// Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used. + /// Bezier curve tension of the line. Set to 0 to draw straight lines. This option is ignored if monotone cubic interpolation is used. /// public double LineTension { get; set; } = 0.4; /// /// If false, the line is not drawn for this dataset. - /// Default is true. If you are filling and dont want to show the line, then change to false. + /// Default is true. If you are filling and don't want to show the line, then change to false. /// public bool ShowLine { get; set; } = true; diff --git a/ChartJs.Blazor/ChartJs.Blazor.xml b/ChartJs.Blazor/ChartJs.Blazor.xml index b0a89ce..83cfc11 100644 --- a/ChartJs.Blazor/ChartJs.Blazor.xml +++ b/ChartJs.Blazor/ChartJs.Blazor.xml @@ -6,7 +6,7 @@ - Config for a bar chart with typesafe data + Config for a bar chart with type safe data Either 'bar' or 'horizontalBar' @@ -37,20 +37,20 @@ - Dataset for Bar Chart with typesafe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties + Dataset for a bar chart with type safe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties Defines the type of data in this dataset. Use Wrappers from for value types. The fill color of the bar. - See for working with colors. + See for working with colors. The color of the bar border. - See for working with colors. + See for working with colors. @@ -61,13 +61,13 @@ The fill color of the bars when hovered. - See for working with colors. + See for working with colors. The stroke color of the bars when hovered. - See for working with colors. + See for working with colors. @@ -77,7 +77,7 @@ - A base dataset for a barchart + A base dataset for a bar chart. Defines the type of data in this dataset. Use Wrappers from for value types. @@ -102,34 +102,32 @@ - - The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack) - - - Specific for stacked bar charts - - + + The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack) + + Specific for stacked bar charts + + - - Dataset for Bar Chart with typesafe Data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties - - - The first value applies to the first bar, the second value to the second bar, and so on. - - - Defines the type of data in this dataset. Use Wrappers from for value types. + + Dataset for a bar chart with type safe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties + + The first value applies to the first bar, the second value to the second bar, and so on. + + + Defines the type of data in this dataset. Use Wrappers from for value types. The fill color of the bar. - See for working with colors. + See for working with colors. The color of the bar border. - See for working with colors. + See for working with colors. @@ -140,13 +138,13 @@ The fill color of the bars when hovered. - See for working with colors. + See for working with colors. The stroke color of the bars when hovered. - See for working with colors. + See for working with colors. @@ -162,13 +160,13 @@ rgba(0,0,0,0.1)'. - See for working with colors. + See for working with colors. rgba(0,0,0,0.1)'. - See for working with colors. + See for working with colors. @@ -178,12 +176,12 @@ - See for working with colors. + See for working with colors. - See for working with colors. + See for working with colors. @@ -207,15 +205,13 @@ The fully converted - - Returns an object that is equivalent to the given parameter but without any null member AND it preserves DotNetInstanceClickHandler/DotNetInstanceHoverHandler members intact - - Preserving DotNetInstanceClick/HoverHandler members is important because they contain DotNetObjectRefs to the instance whose method should be invoked on click/hover - - This whole method is hacky af but necessary. Stripping null members is only needed because the default config for the Line charts on the Blazor side is somehow messed up. If this were not the case no null member stripping were necessary and hence, the recovery of the DotNetObjectRef members would also not be needed. Nevertheless, The Show must go on! - - - + + Returns an object that is equivalent to the given parameter but without any null member AND it preserves DotNetInstanceClickHandler/DotNetInstanceHoverHandler members intact + Preserving DotNetInstanceClick/HoverHandler members is important because they contain DotNetObjectRefs to the instance whose method should be invoked on click/hover + This whole method is hacky af but necessary. Stripping null members is only needed because the default config for the Line charts on the Blazor side is somehow messed up. If this were not the case no null member stripping were necessary and hence, the recovery of the DotNetObjectRef members would also not be needed. Nevertheless, The Show must go on! + + + @@ -294,7 +290,7 @@ - Base class for chart-config which contains the options and the data subconfigs + Base class for chart-config which contains the options and the data sub-configs The type of the options-subconfig The type of the data-subconfig @@ -574,7 +570,7 @@ The color of the grid lines. If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on. - See for working with colors. + See for working with colors. Type has to be string or string[] @@ -617,7 +613,7 @@ Stroke color of the grid line for the first index (index 0). - See for working with colors. + See for working with colors. @@ -639,7 +635,7 @@ - Represents an object that can be either a single value or an array of values. This is used for typesafe js-interop. + Represents an object that can be either a single value or an array of values. This is used for type safe js-interop. The type of data this is supposed to hold. @@ -749,7 +745,7 @@ Color of text. - See for working with colors. + See for working with colors. @@ -1060,7 +1056,7 @@ Gets or sets the font color for a tick's labels. - See for working with colors. + See for working with colors. @@ -1098,7 +1094,7 @@ Gets or sets the font color for labels. - See for working with colors. + See for working with colors. @@ -1562,13 +1558,13 @@ - Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used. + Bezier curve tension of the line. Set to 0 to draw straight lines. This option is ignored if monotone cubic interpolation is used. If false, the line is not drawn for this dataset. - Default is true. If you are filling and dont want to show the line, then change to false. + Default is true. If you are filling and don't want to show the line, then change to false. @@ -1585,19 +1581,19 @@ The fill color under the line. - See for working with colors. + See for working with colors. The fill color of a point. - See for working with colors. + See for working with colors. The color of the line. - See for working with colors. + See for working with colors. @@ -1612,7 +1608,7 @@ - Hover options for hoving over an item + Hover options for hovering over an item @@ -1711,8 +1707,8 @@ - The fontcolor of the label - See for working with colors. + The font color of the label + See for working with colors. @@ -1727,13 +1723,13 @@ - This is a helper class containing premade displayformats to use in for certain locales. + This is a helper class containing pre-made display formats to use in for certain locales. Those s that are not defined, will use the default format from https://www.chartjs.org/docs/latest/axes/cartesian/time.html#display-formats - Premade format-string for the swiss (DE_CH) locale. + Pre-made format-string for the swiss (DE_CH) locale. @@ -1744,7 +1740,7 @@ Sets how different time units are displayed. See https://www.chartjs.org/docs/latest/axes/cartesian/time.html#data-sets for more details. - See for premade formats for certain locales. + See for pre-made formats for certain locales. @@ -1788,34 +1784,34 @@ The minimum display format to be used for a time unit. - + - Represents a point on a graph where the X-Value () is represented by a + Represents a point on a graph where the X-Value () is represented by a Should be used together with a Reference Type so it can be used in the covariant - + - Creates a new instance of + Creates a new instance of The instance to represent the x-value. The value of type which represents the y-value. - + - The time-/x-value for this . + The time-/x-value for this . - + - The y-value for this . + The y-value for this . - The baseclass for a dataset that implements the covariant + The base class for a dataset that implements the covariant Defines the type of data in this dataset. Use Wrappers from for value types. @@ -1901,7 +1897,7 @@ Gets or sets the fill color of the arcs in the dataset. This property should be indexed, otherwise you can't distinguish the different arcs. - See for working with colors. + See for working with colors. @@ -1913,7 +1909,7 @@ Gets or sets the border color of the arcs in the dataset. - See for working with colors. + See for working with colors. @@ -1924,13 +1920,13 @@ Gets or sets the fill colour of the arcs when hovered. - See for working with colors. + See for working with colors. Gets or sets the stroke colour of the arcs when hovered. - See for working with colors. + See for working with colors. @@ -1995,7 +1991,7 @@ Gets or sets the color of the angled lines. - See for working with colors. + See for working with colors. @@ -2017,7 +2013,7 @@ - A linear readial axis. + A linear radial axis. As per documentation here https://www.chartjs.org/docs/latest/axes/radial/linear.html. @@ -2054,7 +2050,7 @@ Gets or sets the color of the label backdrops. - See for working with colors. + See for working with colors. @@ -2126,7 +2122,7 @@ Gets or sets the font color for a point label. - See for working with colors. + See for working with colors. @@ -2183,7 +2179,7 @@ Gets or sets the fill color of the arcs in the dataset. - See for working with colors. + See for working with colors. @@ -2195,7 +2191,7 @@ Gets or sets the border color of the arcs in the dataset. - See for working with colors. + See for working with colors. @@ -2206,13 +2202,13 @@ Gets or sets the fill colour of the arcs when hovered. - See for working with colors. + See for working with colors. Gets or sets the stroke colour of the arcs when hovered. - See for working with colors. + See for working with colors. @@ -2253,13 +2249,13 @@ The fill color under the line. - See for working with colors. + See for working with colors. The color of the line. - See for working with colors. + See for working with colors. @@ -2302,13 +2298,13 @@ The fill color for points. - See for working with colors. + See for working with colors. The border color for points. - See for working with colors. + See for working with colors. @@ -2339,13 +2335,13 @@ Point background color when hovered. - See for working with colors. + See for working with colors. Point border color when hovered. - See for working with colors. + See for working with colors. @@ -2430,13 +2426,13 @@ - Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used. + Bezier curve tension of the line. Set to 0 to draw straight lines. This option is ignored if monotone cubic interpolation is used. If false, the line is not drawn for this dataset. - Default is true. If you are filling and dont want to show the line, then change to false. + Default is true. If you are filling and don't want to show the line, then change to false. @@ -2453,21 +2449,21 @@ The fill color under the line. - See for working with colors. + See for working with colors. The color of the line. - See for working with colors. + See for working with colors. - + Provides useful methods for working with colors. Particularly the conversion from different kinds of C#-colors to string colors which are understood by javascript/css. - + Produces a string of the form 'rgba(r, g, b, 1)' with the provided rgb values where the alpha is fixed at 1 @@ -2476,7 +2472,7 @@ - + Produces a string of the form '#aabbc' with the provided rgb values @@ -2485,7 +2481,7 @@ - + Produces a string of the form 'rgba(r, g, b, alpha)' with the provided rgb and alpha values @@ -2495,13 +2491,13 @@ - + Produces a string of the form 'rgba(r, g, b, alpha)' with random values for rgb and alpha - + Generates the corresponding string representation (as hex) of a object. diff --git a/ChartJs.Blazor/Util/Color/ColorUtil.cs b/ChartJs.Blazor/Util/ColorUtil.cs similarity index 98% rename from ChartJs.Blazor/Util/Color/ColorUtil.cs rename to ChartJs.Blazor/Util/ColorUtil.cs index 7f0084c..acf69dc 100644 --- a/ChartJs.Blazor/Util/Color/ColorUtil.cs +++ b/ChartJs.Blazor/Util/ColorUtil.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; -namespace ChartJs.Blazor.Util.Color +namespace ChartJs.Blazor.Util { /// /// Provides useful methods for working with colors. Particularly the conversion from different kinds of C#-colors to string colors which are understood by javascript/css. diff --git a/DynamicCharts.sln.DotSettings b/DynamicCharts.sln.DotSettings new file mode 100644 index 0000000..742e737 --- /dev/null +++ b/DynamicCharts.sln.DotSettings @@ -0,0 +1,19 @@ + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True \ No newline at end of file diff --git a/WebCore/Data/WeatherForecastService.cs b/WebCore/Data/WeatherForecastService.cs index 299647b..0f57772 100644 --- a/WebCore/Data/WeatherForecastService.cs +++ b/WebCore/Data/WeatherForecastService.cs @@ -6,7 +6,7 @@ namespace WebCore.Data { public class WeatherForecastService { - private static string[] Summaries = new[] + private static readonly string[] Summaries = { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; @@ -27,7 +27,7 @@ public Task GetStaticForecastAsync(DateTime startDate, int am return Task.FromResult(Enumerable.Range(1, amountDays * 24).Select(index => new WeatherForecast { Date = startDate.AddHours(index), - TemperatureC = (int)((double)index * 2.3), + TemperatureC = (int)(index * 2.3), Summary = Summaries[index % Summaries.Length] }).ToArray()); } diff --git a/WebCore/Pages/DoughnutExample.razor b/WebCore/Pages/DoughnutExample.razor index 23edbc1..e8d55f6 100644 --- a/WebCore/Pages/DoughnutExample.razor +++ b/WebCore/Pages/DoughnutExample.razor @@ -33,7 +33,7 @@ config.Data.Labels.AddRange(new[] { "A", "B", "C", "D" }); - var doughnutSet = new PieDataset() + var doughnutSet = new PieDataset { BackgroundColor = new[] { "#ff6384", "#55ee84", "#4463ff", "#efefef" }, BorderWidth = 0, diff --git a/WebCore/Pages/Index.razor b/WebCore/Pages/Index.razor index 16dac31..555e6d2 100644 --- a/WebCore/Pages/Index.razor +++ b/WebCore/Pages/Index.razor @@ -1,5 +1,13 @@ -@page "/" - -

Hello, world!

- -Welcome to your new app. +@page "/" + +

This is an example project to show off our nice charts.

+ +
    +
  • + If you want to read more, visit the wiki page, please. +
  • +
  • + We really like people helping us with the project. + Nevertheless, take your time to read our contributing guidelines. +
  • +
diff --git a/WebCore/Pages/LineLinearExample.razor b/WebCore/Pages/LineLinearExample.razor index 5feeea0..229d5f2 100644 --- a/WebCore/Pages/LineLinearExample.razor +++ b/WebCore/Pages/LineLinearExample.razor @@ -8,7 +8,7 @@ @using ChartJs.Blazor.ChartJS.LineChart @using ChartJs.Blazor.ChartJS.LineChart.Axes @using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks -@using ChartJs.Blazor.Util.Color +@using ChartJs.Blazor.Util @inject WeatherForecastService ForecastService

Line Linear Chart

@@ -23,7 +23,7 @@ private LineDataset tempPerHourSet; private LineDataset tempPerDaySet; - private Random rnd = new Random(); + private readonly Random rnd = new Random(); protected override async Task OnInitializedAsync() { @@ -120,8 +120,9 @@ var onlyDays = forecasts.GroupBy(f => f.Date.Day).Select(g => g.First()); - tempPerHourSet.AddRange(onlyDays.Select(p => new Point(p.Date.Hour, p.TemperatureC))); - tempPerDaySet.AddRange(onlyDays.Select(p => new Point(p.Date.Day, p.TemperatureF))); + IEnumerable weatherForecasts = onlyDays.ToList(); + tempPerHourSet.AddRange(weatherForecasts.Select(p => new Point(p.Date.Hour, p.TemperatureC))); + tempPerDaySet.AddRange(weatherForecasts.Select(p => new Point(p.Date.Day, p.TemperatureF))); lineConfig.Data.Datasets.Add(tempPerHourSet); lineConfig.Data.Datasets.Add(tempPerDaySet); diff --git a/WebCore/Pages/LineLogarithmicExample.razor b/WebCore/Pages/LineLogarithmicExample.razor index b7ace97..ae2e1a3 100644 --- a/WebCore/Pages/LineLogarithmicExample.razor +++ b/WebCore/Pages/LineLogarithmicExample.razor @@ -8,7 +8,7 @@ @using ChartJs.Blazor.ChartJS.LineChart @using ChartJs.Blazor.ChartJS.LineChart.Axes @using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks -@using ChartJs.Blazor.Util.Color +@using ChartJs.Blazor.Util @inject WeatherForecastService ForecastService

Line Logarithmic Chart

@@ -47,7 +47,7 @@ Scales = new Scales { xAxes = new List - { + { new LinearCartesianAxis { ScaleLabel = new ScaleLabel @@ -65,7 +65,7 @@ } }, yAxes = new List() - { + { new LogarithmicAxis { ScaleLabel = new ScaleLabel @@ -111,10 +111,11 @@ WeatherForecast[] forecasts = await ForecastService.GetStaticForecastAsync(DateTime.Now, 5); - var onlyDays = forecasts.GroupBy(f => f.Date.Day).Select(g => g.First()); + IEnumerable onlyDays = forecasts.GroupBy(f => f.Date.Day).Select(g => g.First()); - tempPerHourSet.AddRange(onlyDays.Select(p => new Point(p.Date.Hour, p.TemperatureC))); - tempPerDaySet.AddRange(onlyDays.Select(p => new Point(p.Date.Day, p.TemperatureF))); + var weatherForecasts = onlyDays.ToList(); + tempPerHourSet.AddRange(weatherForecasts.Select(p => new Point(p.Date.Hour, p.TemperatureC))); + tempPerDaySet.AddRange(weatherForecasts.Select(p => new Point(p.Date.Day, p.TemperatureF))); lineConfig.Data.Datasets.Add(tempPerHourSet); lineConfig.Data.Datasets.Add(tempPerDaySet); diff --git a/WebCore/Pages/LineTimeExample.razor b/WebCore/Pages/LineTimeExample.razor index 14b820d..61fb0c9 100644 --- a/WebCore/Pages/LineTimeExample.razor +++ b/WebCore/Pages/LineTimeExample.razor @@ -2,7 +2,6 @@ @using WebCore.Data @using ChartJs.Blazor.Charts @using ChartJs.Blazor.ChartJS -@using ChartJs.Blazor.ChartJS.Common @using ChartJs.Blazor.ChartJS.Common.Properties @using ChartJs.Blazor.ChartJS.Common.Enums @using ChartJs.Blazor.ChartJS.Common.Legends @@ -97,7 +96,7 @@ var forecasts = await ForecastService.GetForecastAsync(DateTime.Now, 2); - var tempDataSet = new LineDataset> + var tempDataSet = new LineDataset> { BackgroundColor = "#ff6384", BorderColor = "#ff6384", @@ -109,7 +108,7 @@ SteppedLine = SteppedLine.False }; - tempDataSet.AddRange(forecasts.Select(p => new TimeTupel(new Moment(p.Date), p.TemperatureC))); + tempDataSet.AddRange(forecasts.Select(p => new TimeTuple(new Moment(p.Date), p.TemperatureC))); lineConfig.Data.Datasets.Add(tempDataSet); } diff --git a/WebCore/Pages/PieExample.razor b/WebCore/Pages/PieExample.razor index eee9bc1..8d1d889 100644 --- a/WebCore/Pages/PieExample.razor +++ b/WebCore/Pages/PieExample.razor @@ -2,7 +2,6 @@ @using ChartJs.Blazor.Charts @using ChartJs.Blazor.ChartJS.PieChart @using ChartJs.Blazor.ChartJS.Common.Properties -@using ChartJs.Blazor.Util.Color

Pie Chart

diff --git a/WebCore/Pages/SimpleLineLinearExample.razor b/WebCore/Pages/SimpleLineLinearExample.razor index 5f38f56..05647a9 100644 --- a/WebCore/Pages/SimpleLineLinearExample.razor +++ b/WebCore/Pages/SimpleLineLinearExample.razor @@ -1,5 +1,4 @@ @page "/SimpleLineLinearExample" -@using WebCore.Data @using ChartJs.Blazor.Charts @using ChartJs.Blazor.ChartJS.Common @using ChartJs.Blazor.ChartJS.Common.Properties @@ -7,7 +6,7 @@ @using ChartJs.Blazor.ChartJS.Common.Legends @using ChartJs.Blazor.ChartJS.LineChart @using ChartJs.Blazor.ChartJS.LineChart.Axes -@using ChartJs.Blazor.Util.Color +@using ChartJs.Blazor.Util

Line Linear Chart

@@ -20,7 +19,7 @@ private LineDataset pointDataset; - private Random rnd = new Random(); + private readonly Random rnd = new Random(); protected override void OnInitialized() { diff --git a/WebCore/Pages/_Host.cshtml b/WebCore/Pages/_Host.cshtml index ce1d3ca..6bfc3f5 100644 --- a/WebCore/Pages/_Host.cshtml +++ b/WebCore/Pages/_Host.cshtml @@ -40,7 +40,7 @@ You have to actually use "_content/ChartJs.Blazor/" for it to work correctly. This might change in a later preview. Currently there are some issues with this (at least in server-side blazor). - It doesn't always work and the static files arent accessable. + It doesn't always work and the static files aren't accessible. Theses issues will hopefully be resolved in the upcoming .net previews. *@ @@ -49,7 +49,7 @@ *@ - @* Manually include because it doesn't work with server sider blazor *@ + @* Manually include because it doesn't work with server side blazor *@ diff --git a/WebCore/Program.cs b/WebCore/Program.cs index 56212eb..851c61a 100644 --- a/WebCore/Program.cs +++ b/WebCore/Program.cs @@ -1,13 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; namespace WebCore { diff --git a/WebCore/Shared/MainLayout.razor b/WebCore/Shared/MainLayout.razor index d02020a..3c8bb0a 100644 --- a/WebCore/Shared/MainLayout.razor +++ b/WebCore/Shared/MainLayout.razor @@ -1,4 +1,4 @@ -@inherits LayoutComponentBase +@inherits Microsoft.AspNetCore.Components.LayoutComponentBase