Skip to content

Commit 24f2f4e

Browse files
committed
Added forecast datapoints
1 parent b75a10e commit 24f2f4e

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

docs/BlazorApexCharts.Docs/Components/LineCharts/DataLabels.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<ApexChart TItem="Order"
33
Title="Order Net Value"
44
ChartType="@ChartType.Line"
5-
Options="@options"
6-
Debug>
5+
Options="@options">
6+
77

88
<ApexSeries TItem="Order"
99
Items="Orders"

docs/BlazorApexCharts.Docs/Components/LineCharts/DateTime.razor

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<ApexChart TItem="Order" Title="Orders Value"
33
ChartType="ChartType.Line"
44
XAxisType="XaxisType.Datetime"
5-
Options="options">
5+
Options="options"
6+
Debug>
67

78
<ApexSeries TItem="Order"
89
Items="SampleData.GetOrders()"
@@ -26,11 +27,15 @@
2627
{
2728

2829
options.Debug = true;
29-
options.Tooltip = new ApexCharts.Tooltip { X = new TooltipX { Format = @"MMMM \ yyyy" } };
30+
options.ForecastDataPoints = new ForecastDataPoints
31+
{
32+
Count = 3,
33+
DashArray = 4,
34+
FillOpacity = 0.5,
3035

36+
};
37+
options.Tooltip = new ApexCharts.Tooltip { X = new TooltipX { Format = @"MMMM \ yyyy" } };
3138
options.Subtitle = new Subtitle { OffsetY = 15, Text = "DateTime sample with options" };
32-
33-
3439
options.Tooltip = new ApexCharts.Tooltip
3540
{
3641
Y = new TooltipY
@@ -39,8 +44,6 @@
3944
Formatter = @"function(value, { series, seriesIndex, dataPointIndex, w }) { return '$' + value }"
4045
},
4146
};
42-
43-
4447
options.Xaxis = new XAxis
4548
{
4649
Title = new AxisTitle
@@ -58,6 +61,7 @@
5861
options.Yaxis = new List<YAxis>();
5962
options.Yaxis.Add(new YAxis
6063
{
64+
DecimalsInFloat = 0,
6165
Labels = new AxisLabels { Rotate = -45, Style = new AxisLabelStyle { FontSize = "10px" } },
6266
Title = new AxisTitle { Text = "Value", Style = new AxisTitleStyle { FontSize = "14px", Color = "lightgrey" } }
6367
});

src/Blazor-ApexCharts/Models/ApexChartOptions.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public class ApexChartOptions<TItem>
7575
public List<Series<TItem>> Series { get; set; }
7676

7777
public List<object> SeriesNonXAxis { get; internal set; }
78+
public ForecastDataPoints ForecastDataPoints { get; set; }
7879

7980
public States States { get; set; }
8081

@@ -117,6 +118,16 @@ public class ApexChartOptions<TItem>
117118
public List<YAxis> Yaxis { get; set; }
118119
}
119120

121+
public class ForecastDataPoints
122+
{
123+
public int Count { get; set; }
124+
public double? FillOpacity { get; set; }
125+
public double? StrokeWidth { get; set; }
126+
public double? DashArray { get; set; }
127+
}
128+
129+
130+
120131
public class PlotOptionsTreemap
121132
{
122133
public bool? EnableShades { get; set; }
@@ -143,7 +154,7 @@ public class TreemapRanges
143154
public string ForeColor { get; set; }
144155
public string Name { get; set; }
145156
}
146-
157+
147158
public class Annotations
148159
{
149160
public List<AnnotationsImage> Images { get; set; }
@@ -1273,6 +1284,7 @@ public class XAxis
12731284
public object Categories { get; set; }
12741285
public AxisCrosshairs Crosshairs { get; set; }
12751286
public bool? Floating { get; set; }
1287+
public int? DecimalsInFloat { get; set; }
12761288
public AxisLabels Labels { get; set; }
12771289
public object Max { get; set; }
12781290
public object Min { get; set; }
@@ -1417,7 +1429,7 @@ public class YAxis
14171429
public AxisBorder AxisBorder { get; set; }
14181430
public AxisTicks AxisTicks { get; set; }
14191431
public AxisCrosshairs Crosshairs { get; set; }
1420-
public double? DecimalsInFloat { get; set; }
1432+
public int? DecimalsInFloat { get; set; }
14211433
public bool? Floating { get; set; }
14221434
public bool? ForceNiceScale { get; set; }
14231435
public AxisLabels Labels { get; set; }
@@ -2705,9 +2717,9 @@ public class Style6
27052717
public object FontWeight { get; set; }
27062718
}
27072719

2708-
27092720

2710-
2721+
2722+
27112723

27122724
public enum Easing { Easein, Easeinout, Easeout, Linear };
27132725

@@ -2750,7 +2762,7 @@ public enum TickAmountEnum { DataPoints };
27502762

27512763
public enum XaxisType { Category, Datetime, Numeric };
27522764

2753-
2765+
27542766
public struct Download
27552767
{
27562768
public bool? Bool;

0 commit comments

Comments
 (0)