Skip to content

Commit e86821b

Browse files
committed
Updated Blazor components Getting Started UG documentation for Blazor Web App
1 parent 5ccebab commit e86821b

File tree

4 files changed

+280
-172
lines changed

4 files changed

+280
-172
lines changed

blazor/3D-chart/getting-started-with-web-app.md

Lines changed: 70 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ documentation: ug
99

1010
# Getting Started with Blazor 3D Chart Component in Web App
1111

12-
This section briefly explains about how to include `Blazor 3D Chart` component in your Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/) and Visual Studio Code.
12+
This section briefly explains about how to include [Blazor 3D Chart](https://www.syncfusion.com/blazor-components/blazor-3d-charts) component in your Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/).
1313

1414
To get started quickly with Blazor 3D Chart component, check on the following video:
1515

@@ -28,13 +28,13 @@ To get started quickly with Blazor 3D Chart component, check on the following vi
2828

2929
You can create a **Blazor Web App** using Visual Studio 2022 via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vs) or the [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio).
3030

31-
You need to configure the corresponding [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vs) while creating a Blazor Web Application.
31+
Configure the appropriate [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vs) while creating a Blazor Web App.
3232

3333
## Install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor 3D Chart NuGet in the Blazor Web App
3434

35-
To add **Blazor 3D Chart** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install [Syncfusion.Blazor.Chart3D](https://www.nuget.org/packages/Syncfusion.Blazor.Chart3D).
35+
To add the **Blazor 3D Chart** component in the app, open NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), then search and install [Syncfusion.Blazor.Chart3D](https://www.nuget.org/packages/Syncfusion.Blazor.Chart3D).
3636

37-
If you utilize `WebAssembly or Auto` render modes in the Blazor Web App need to be install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components NuGet packages within the client project.
37+
If using the `WebAssembly or Auto` render modes in the Blazor Web App, install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages in the client project.
3838

3939
Alternatively, you can utilize the following package manager command to achieve the same.
4040

@@ -46,7 +46,7 @@ Install-Package Syncfusion.Blazor.Chart3D -Version {{ site.releaseversion }}
4646
{% endhighlight %}
4747
{% endtabs %}
4848

49-
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details.
49+
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet packages list with component details.
5050

5151
{% endtabcontent %}
5252

@@ -60,7 +60,7 @@ N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are availa
6060

6161
You can create a **Blazor Web App** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vsc) or the [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project).
6262

63-
You need to configure the corresponding [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vsc) while creating a Blazor Web Application.
63+
Configure the appropriate interactive render mode and interactivity location when setting up a Blazor Web App. For detailed information, refer to the [interactive render mode documentation](https://blazor.syncfusion.com/documentation/common/interactive-render-mode).
6464

6565
For example, in a Blazor Web App with the `Auto` interactive render mode, use the following commands.
6666

@@ -74,11 +74,9 @@ cd BlazorWebApp.Client
7474
{% endhighlight %}
7575
{% endtabs %}
7676

77-
N> For more information on creating a **Blazor Web App** with various interactive modes and locations, refer to this [link](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=visual-studio-code#render-interactive-modes).
78-
7977
## Install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Chart3D NuGet in the App
8078

81-
If you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App need to be install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components NuGet packages within the client project.
79+
If using the `WebAssembly` or `Auto` render modes in the Blazor Web App, install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages in the client project.
8280

8381
* Press <kbd>Ctrl</kbd>+<kbd>`</kbd> to open the integrated terminal in Visual Studio Code.
8482
* Ensure you’re in the project root directory where your `.csproj` file is located.
@@ -99,16 +97,65 @@ N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are availa
9997

10098
{% endtabcontent %}
10199

102-
{% endtabcontents %}
100+
{% tabcontent .NET CLI %}
103101

104-
## Register Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service
102+
### Prerequisites
103+
104+
Latest version of the [.NET SDK](https://dotnet.microsoft.com/en-us/download). If you previously installed the SDK, you can determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux).
105+
106+
{% tabs %}
107+
{% highlight c# tabtitle=".NET CLI" %}
108+
109+
dotnet --version
110+
111+
{% endhighlight %}
112+
{% endtabs %}
113+
114+
### Create a Blazor Web App using .NET CLI
115+
116+
Run the following command to create a new Blazor Web App in a command prompt (Windows) or terminal (macOS) or command shell (Linux).
117+
118+
Configure the appropriate interactive render mode and interactivity location when setting up a Blazor Web Application. For detailed information, refer to the [interactive render mode documentation](https://blazor.syncfusion.com/documentation/common/interactive-render-mode).
119+
120+
For example, in a Blazor Web App with the `Auto` interactive render mode, use the following commands.
121+
122+
{% tabs %}
123+
{% highlight c# tabtitle="Blazor Web App" %}
124+
125+
dotnet new blazor -o BlazorWebApp -int Auto
126+
cd BlazorWebApp
127+
cd BlazorWebApp.Client
128+
129+
{% endhighlight %}
130+
{% endtabs %}
131+
132+
This command creates a new Blazor Web App and places it in a new directory called `BlazorWebApp` inside your current location. See the [Create a Blazor App](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?pivots=linux-macos&view=aspnetcore-8.0) topics for more details.
133+
134+
### Install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Chart3D and Themes NuGet in the App
135+
136+
Here's an example of how to add the **Blazor 3D Chart** component to the application by using the following commands in a command prompt (Windows), terminal (Linux and macOS), or PowerShell to install the [Syncfusion.Blazor.Chart3D](https://www.nuget.org/packages/Syncfusion.Blazor.Chart3D/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) for more details.
137+
138+
If using the `WebAssembly` or `Auto` render modes in the Blazor Web App, install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages in the client project.
139+
140+
{% tabs %}
141+
{% highlight c# tabtitle=".NET CLI" %}
142+
143+
dotnet add package Syncfusion.Blazor.Chart3D --version {{ site.releaseversion }}
144+
dotnet add package Syncfusion.Blazor.Themes --version {{ site.releaseversion }}
145+
dotnet restore
146+
147+
{% endhighlight %}
148+
{% endtabs %}
149+
150+
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet package list with component details.
151+
152+
{% endtabcontent %}
153+
154+
{% endtabcontents %}
105155

106-
| Interactive Render Mode | Description |
107-
| -- | -- |
108-
| WebAssembly or Auto | Open **~/_Imports.razor** file from the client project.|
109-
| Server | Open **~/_import.razor** file, which is located in the `Components` folder.|
156+
### Add Import Namespaces
110157

111-
Import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Chart3D` namespace.
158+
Open the **~/_Imports.razor** file in the client project and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Chart3D` namespaces.
112159

113160
{% tabs %}
114161
{% highlight C# tabtitle="~/_Imports.razor" %}
@@ -119,9 +166,11 @@ Import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Chart3D` namespace.
119166
{% endhighlight %}
120167
{% endtabs %}
121168

122-
Now, register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service in the **~/Program.cs** file of your Blazor Web App.
169+
## Register Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service
170+
171+
Register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service in the **~/Program.cs** file of your Blazor Web App.
123172

124-
If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, you need to register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor service in both **~/Program.cs** files of your Blazor Web App.
173+
If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor service in both **~/Program.cs** files of the Blazor Web App.
125174

126175
{% tabs %}
127176
{% highlight c# tabtitle="Server(~/_Program.cs)" hl_lines="3 11" %}
@@ -155,27 +204,6 @@ await builder.Build().RunAsync();
155204
{% endhighlight %}
156205
{% endtabs %}
157206

158-
If the **Interactive Render Mode** is set to `Server`, your project will contain a single **~/Program.cs** file. So, you should register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service only in that **~/Program.cs** file.
159-
160-
{% tabs %}
161-
{% highlight c# tabtitle="~/_Program.cs" hl_lines="2 9" %}
162-
163-
...
164-
using Syncfusion.Blazor;
165-
166-
var builder = WebApplication.CreateBuilder(args);
167-
168-
// Add services to the container.
169-
builder.Services.AddRazorComponents()
170-
.AddInteractiveServerComponents();
171-
builder.Services.AddSyncfusionBlazor();
172-
173-
var app = builder.Build();
174-
....
175-
176-
{% endhighlight %}
177-
{% endtabs %}
178-
179207
## Add script resources
180208

181209
The script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the script reference at the end of the `<body>` in the **~/Components/App.razor** file as shown below:
@@ -191,16 +219,15 @@ N> Check out the [Adding Script Reference](https://blazor.syncfusion.com/documen
191219

192220
## Add Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor 3D Chart component
193221

194-
Add the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor 3D Chart component in `.razor` file inside the `Pages` folder. If an interactivity location as `Per page/component` in the web app, define a render mode at top of the component, as follows:
222+
Add the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor 3D Chart component in the **~/Components/Pages/*.razor** file. If the interactivity location is set to `Per page/component` in the Web App, define a render mode at the top of the `~Pages/*.razor` component, as follows:
195223

196224
| Interactivity location | RenderMode | Code |
197225
| --- | --- | --- |
198226
| Per page/component | Auto | @rendermode InteractiveAuto |
199227
| | WebAssembly | @rendermode InteractiveWebAssembly |
200-
| | Server | @rendermode InteractiveServer |
201228
| | None | --- |
202229

203-
N> If an **Interactivity Location** is set to `Global` and the **Render Mode** is set to `Auto` or `WebAssembly` or `Server`, the render mode is configured in the `App.razor` file by default.
230+
N> If an **Interactivity Location** is set to `Global` and the **Render Mode** is set to `Auto` or `WebAssembly`, the render mode is configured in the `App.razor` file by default.
204231

205232
{% tabs %}
206233
{% highlight razor %}
@@ -221,7 +248,7 @@ N> If an **Interactivity Location** is set to `Global` and the **Render Mode** i
221248
{% endhighlight %}
222249
{% endtabs %}
223250

224-
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor 3D Chart component in your default web browser.
251+
* Press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows) or <kbd>⌘</kbd>+<kbd>F5</kbd> (macOS) to launch the application. This will render the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor 3D Chart component in the default web browser.
225252

226253
## Populate Blazor 3D Chart with data
227254

0 commit comments

Comments
 (0)