File tree Expand file tree Collapse file tree 5 files changed +54
-6
lines changed
docs/BlazorApexCharts.Docs/Components/Features/Data Expand file tree Collapse file tree 5 files changed +54
-6
lines changed Original file line number Diff line number Diff line change 22
33<DocExamples Title =" Chart Data" >
44
5+ <CodeSnippet Title =" Group Values" ClassName =@typeof(GroupValues).ToString() >
6+ <Snippet >
7+ <GroupValues />
8+ </Snippet >
9+ </CodeSnippet >
10+ @*
511 <CodeSnippet Title="Data Async" ClassName=@typeof(DataAsync).ToString()>
612 <Snippet>
713 <DataAsync />
1319 <NoData />
1420 </Snippet>
1521 </CodeSnippet>
16-
22+ *@
1723</DocExamples >
Original file line number Diff line number Diff line change 1+ <DemoContainer >
2+ <ApexChart TItem =" Order"
3+ Title =" Order Gross Value"
4+ GroupValues =" new ApexCharts.GroupValues { MaxValuesCount = 4}" >
5+
6+ <ApexPointSeries TItem =" Order"
7+ Items =" Orders"
8+ Name =" Gross Value"
9+ SeriesType =" SeriesType.Pie"
10+ XValue =" @(e => e.Country)"
11+ YAggregate =" @(e => e.Sum(e => e.GrossValue))"
12+ OrderByDescending =" e=>e.Y" />
13+ </ApexChart >
14+ </DemoContainer >
15+
16+ @code {
17+ private List <Order > Orders { get ; set ; } = SampleData .GetOrders ();
18+ }
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public partial class ApexChart<TItem> : IDisposable where TItem : class
3636
3737 [ Parameter ] public EventCallback OnRendered { get ; set ; }
3838 [ Parameter ] public Func < decimal , string > FormatYAxisLabel { get ; set ; }
39+ [ Parameter ] public GroupValues GroupValues { get ; set ; }
3940
4041 private ChartSerializer chartSerializer = new ( ) ;
4142 public List < IApexSeries < TItem > > Series => apexSeries ;
Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
1+ using System . Collections . Generic ;
52using System . Text . Json . Serialization ;
6- using System . Threading . Tasks ;
73
84namespace ApexCharts
95{
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Text ;
5+ using System . Threading . Tasks ;
6+
7+ namespace ApexCharts
8+ {
9+ public class GroupValues
10+ {
11+ /// <summary>
12+ /// Indicates the max value of values to show, including the grouped values.
13+ /// </summary>
14+ public int ? MaxValuesCount { get ; set ; }
15+
16+ /// <summary>
17+ /// The precentage value that indicate if a value should be grouped.
18+ /// </summary>
19+ public decimal ? PercentageThreshold { get ; set ; }
20+
21+ public string Name { get ; set ; } = "Other" ;
22+ public bool Show { get ; set ; } = true ;
23+ }
24+
25+
26+
27+ }
You can’t perform that action at this time.
0 commit comments