File tree Expand file tree Collapse file tree 3 files changed +56
-2
lines changed
docs/BlazorApexCharts.Docs/Components/ChartTypes/LineCharts
src/Blazor-ApexCharts/Models/DataPoints Expand file tree Collapse file tree 3 files changed +56
-2
lines changed Original file line number Diff line number Diff line change 5050 </Snippet >
5151 </CodeSnippet >
5252
53+ <CodeSnippet Title =" Point Mutator" ClassName =@typeof(PointMutate).ToString() >
54+ <Snippet >
55+ <PointMutate />
56+ </Snippet >
57+ </CodeSnippet >
58+
5359</DocExamples >
Original file line number Diff line number Diff line change 1+ <DemoContainer >
2+ <ApexChart TItem =" Order"
3+ Title =" Order Net Value" Options =" @options" >
4+
5+ <ApexPointSeries TItem =" Order"
6+ Items =" Orders"
7+ Name =" Gross Value"
8+
9+ SeriesType =" SeriesType.Line"
10+ XValue =" @(e => e.OrderDate)"
11+ YValue =" @(e => e.GrossValue)"
12+ DataPointMutator =" MutateDataPoint"
13+ OrderByDescending =" e=>e.Y" />
14+ </ApexChart >
15+ </DemoContainer >
16+
17+ @code {
18+ private List <Order > Orders { get ; set ; } = SampleData .GetOrders ().Where (n => n .Country == " Sweden" ).ToList ();
19+
20+ private ApexChartOptions <Order > options = new ApexCharts .ApexChartOptions <Order >()
21+ {
22+ Markers = new Markers
23+ {
24+ Size = 6 ,
25+ FillOpacity = 1 ,
26+ StrokeWidth = 2 ,
27+ StrokeColors = new List <string > { " #FFFFFF" },
28+ Colors = new List <string > { " #0000FF" },
29+ StrokeOpacity = 1 d
30+ }
31+ };
32+
33+ private void MutateDataPoint (DataPoint < Order > point )
34+ {
35+ var max = Orders .Max (e => e .GrossValue );
36+
37+ if (point .Items .Any (n => n .GrossValue == max ))
38+ {
39+ point .FillColor = " #FF0000" ;
40+ point .StrokeColor = " #00FFFF" ;
41+ }
42+ }
43+ }
Original file line number Diff line number Diff line change @@ -12,8 +12,13 @@ public class DataPoint<TItem> : IDataPoint<TItem>
1212 /// <inheritdoc cref="IDataPoint{TItem}.FillColor"/>
1313 public string FillColor { get ; set ; }
1414
15- /// <inheritdoc cref="IDataPoint{TItem}.X"/>
16- public object X { get ; set ; }
15+ /// <summary>
16+ /// Controls the color of the border around the data point
17+ /// </summary>
18+ public string StrokeColor { get ; set ; }
19+
20+ /// <inheritdoc cref="IDataPoint{TItem}.X"/>
21+ public object X { get ; set ; }
1722
1823 /// <summary>
1924 /// A collection of goal markers to display with the data point
You can’t perform that action at this time.
0 commit comments