Skip to content

Commit bdf1502

Browse files
committed
Added Chart Size sample
1 parent dc64fc2 commit bdf1502

File tree

5 files changed

+106
-12
lines changed

5 files changed

+106
-12
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
{
2-
"iisSettings": {
3-
"windowsAuthentication": false,
4-
"anonymousAuthentication": true,
5-
"iisExpress": {
6-
"applicationUrl": "http://localhost:46190",
7-
"sslPort": 44369
8-
}
9-
},
102
"profiles": {
113
"IIS Express": {
124
"commandName": "IISExpress",
135
"launchBrowser": true,
14-
"launchUrl": "area-charts",
6+
"launchUrl": "eatures/chart-size",
157
"environmentVariables": {
168
"ASPNETCORE_ENVIRONMENT": "Development"
179
}
@@ -25,5 +17,13 @@
2517
"applicationUrl": "https://localhost:5001;http://localhost:5000",
2618
"dotnetRunMessages": "true"
2719
}
20+
},
21+
"iisSettings": {
22+
"windowsAuthentication": false,
23+
"anonymousAuthentication": true,
24+
"iisExpress": {
25+
"applicationUrl": "http://localhost:46190",
26+
"sslPort": 44369
27+
}
2828
}
2929
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
<ApexChart TItem="Order"
3+
Title="Scatter Sample" Height="200">
4+
5+
<ApexPointSeries TItem="Order"
6+
Items="orders"
7+
SeriesType="@SeriesType.Area"
8+
Name="Gross Value"
9+
XValue="@(e => e.Country)"
10+
YAggregate="@(e => e.Sum(e => e.GrossValue))"
11+
OrderByDescending="e=>e.Y" />
12+
13+
<ApexPointSeries TItem="Order"
14+
Items="orders"
15+
SeriesType="@SeriesType.Area"
16+
Name="Net Value"
17+
XValue="@(e => e.Country)"
18+
YAggregate="@(e => e.Sum(e => e.NetValue))"
19+
OrderByDescending="e=>e.Y" />
20+
</ApexChart>
21+
22+
23+
@code {
24+
private List<Order> orders { get; set; } = SampleData.GetOrders();
25+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
<Row>
3+
<RowCol Auto>
4+
<label class="form-label">Width</label>
5+
<input type="number" @bind=@width class="form-control" />
6+
</RowCol>
7+
<RowCol Auto>
8+
<label class="form-label">Height</label>
9+
<input type="number" @bind=@height class="form-control" />
10+
</RowCol>
11+
</Row>
12+
13+
<Row class="mt-2 mb-2">
14+
<RowCol Auto>
15+
<Button BackgroundColor="TablerColor.Primary" OnClick="UpdateSize">Update Size</Button>
16+
</RowCol>
17+
</Row>
18+
19+
<div style="overflow-x:scroll;overflow-y:hidden">
20+
<ApexChart TItem="Order"
21+
Title="Scatter Sample"
22+
Width="@width"
23+
Height="@height"
24+
@ref="chart">
25+
26+
<ApexPointSeries TItem="Order"
27+
Items="orders"
28+
SeriesType="@SeriesType.Area"
29+
Name="Gross Value"
30+
XValue="@(e => e.Country)"
31+
YAggregate="@(e => e.Sum(e => e.GrossValue))"
32+
OrderByDescending="e=>e.Y" />
33+
34+
<ApexPointSeries TItem="Order"
35+
Items="orders"
36+
SeriesType="@SeriesType.Area"
37+
Name="Net Value"
38+
XValue="@(e => e.Country)"
39+
YAggregate="@(e => e.Sum(e => e.NetValue))"
40+
OrderByDescending="e=>e.Y" />
41+
</ApexChart>
42+
</div>
43+
44+
45+
@code {
46+
private List<Order> orders { get; set; } = SampleData.GetOrders();
47+
private ApexChart<Order> chart;
48+
private int height = 200;
49+
private int width = 600;
50+
51+
private async Task UpdateSize()
52+
{
53+
await Task.Yield();
54+
await chart.UpdateOptionsAsync(false, false, false);
55+
}
56+
57+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@page "/features/chart-size"
2+
3+
<DocExamples Title="Chart Size">
4+
5+
<CodeSnippet Title="Basic" ClassName=@typeof(Basic).ToString()>
6+
<Snippet>
7+
<Basic />
8+
</Snippet>
9+
</CodeSnippet>
10+
11+
</DocExamples>

docs/BlazorApexCharts.Docs/Shared/MainNavigation.razor

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
</MenuItemIcon>
7575
</NavbarMenuItem>
7676

77-
<NavbarMenuItem Href="radar-charts" Text="Radar">
77+
<NavbarMenuItem Href="radar-charts" Text="Radar">
7878
<MenuItemIcon>
7979
<Icon class="icon" IconType="@Icons.Chart_radar" />
8080
</MenuItemIcon>
@@ -126,7 +126,8 @@
126126
<NavbarMenuItem Text="Formatters" Href="features/formatters" />
127127
<NavbarMenuItem Text="Legend" Href="features/legend" />
128128
<NavbarMenuItem Text="Performance" Href="features/performance" />
129-
<NavbarMenuItem Text="State" Href="features/state" />
129+
<NavbarMenuItem Text="Size" Href="features/chart-size" />
130+
<NavbarMenuItem Text="State" Href="features/state" />
130131
<NavbarMenuItem Text="Syncronized charts" Href="features/syncronized" />
131132
<NavbarMenuItem Text="Custom Tooltip" Href="features/tooltip" />
132133
</SubMenu>
@@ -143,7 +144,7 @@
143144
<NavbarMenuItem Text="Data Uri" Href="methods/data-uri" />
144145
<NavbarMenuItem Text="Render" Href="methods/render" />
145146
<NavbarMenuItem Text="Toggle Data Point" Href="methods/toggle-data-point" />
146-
<NavbarMenuItem Text="Update Options" Href="methods/update-options" />
147+
<NavbarMenuItem Text="Update Options" Href="methods/update-options" />
147148
<NavbarMenuItem Text="Update Series" Href="methods/update-series" />
148149
<NavbarMenuItem Text="Show/Hide Series" Href="methods/show-hide-series" />
149150
<NavbarMenuItem Text="Zoom X" Href="methods/zoomx" />

0 commit comments

Comments
 (0)