Skip to content

Commit a419f96

Browse files
authored
doc(Chart): update Chart line type sample code (#2408)
* refactor: 重构代码 * chore: bump version 8.0.3-beta01
1 parent 37616a4 commit a419f96

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/BootstrapBlazor.Server/Components/Samples/Charts/Line.razor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public partial class Line
2323
[NotNull]
2424
private ConsoleLogger? Logger { get; set; }
2525

26-
private ChartPointStyle[] chartPointStyles = new[]
27-
{
26+
private readonly ChartPointStyle[] chartPointStyles =
27+
[
2828
ChartPointStyle.Circle,
2929
ChartPointStyle.Cross,
3030
ChartPointStyle.CrossRot,
@@ -35,7 +35,7 @@ public partial class Line
3535
ChartPointStyle.RectRot,
3636
ChartPointStyle.Star,
3737
ChartPointStyle.Triangle,
38-
};
38+
];
3939

4040
/// <summary>
4141
/// <inheritdoc/>
@@ -237,7 +237,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
237237

238238
if (firstRender)
239239
{
240-
Module = await JSRuntime.InvokeAsync<IJSObjectReference>("import", $"Components/Samples/Charts/Line.razor.js?v={JSVersionService.GetVersion()}");
240+
Module = await JSRuntime.InvokeAsync<IJSObjectReference>("import", $"./Components/Samples/Charts/Line.razor.js?v={JSVersionService.GetVersion()}");
241241

242242
//随机生成一组数据
243243
//Randomly generate a set of data

src/BootstrapBlazor.Server/Components/Samples/Charts/Line.razor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//通过相对路径导入BootstrapBlazor.Chart的Chart.JS模块
2-
import '../../../../_content/BootstrapBlazor.Chart/js/chart.js'
3-
import Data from '../../../../_content/BootstrapBlazor/modules/data.js'
2+
import '../../../_content/BootstrapBlazor.Chart/js/chart.js'
3+
import Data from '../../../_content/BootstrapBlazor/modules/data.js'
44

55
export function lineChart(canvasId, chartData) {
66
const ctx = document.getElementById(canvasId);

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>8.0.2</Version>
4+
<Version>8.0.3-beta01</Version>
55
</PropertyGroup>
66

77
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

0 commit comments

Comments
 (0)