Search results

Getting Started

This section briefly explains how to include a Smithchart in your Blazor client-side application. Refer to this Getting Started with Syncfusion Blazor for Client-Side in Visual Studio 2019 Preview documentation for introduction and configuring the common specifications.

Importing Syncfusion Blazor component in an application

  1. Install Syncfusion.EJ2.Blazor NuGet package to an application using the NuGet Package Manager. Make sure to check the Include prerelease option.
  2. Add the client-side resources through CDN link in the <head> element of the ~/wwwroot/index.html page.
<head>
    <environment include="Development">
        <script src="https://cdn.syncfusion.com/ej2/17.3.29/dist/ej2.min.js" ></script>
     </environment>
</head>

Adding component package to an application

Open the ~/_Imports.razor file and import the Syncfusion.EJ2.Blazor.Charts package.

@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.Charts

Adding Smith Chart component to an application

Now, add the Syncfusion Blazor Smith Chart component in any webpage razor in the pages folder. For example, the Smith Chart component is added to the ~/Pages/Index.razor page.

@using Syncfusion.EJ2.Blazor.Charts

<EjsSmithchart></EjsSmithchart>

Run the application

After the successful compilation of your application, press F5 to run the application. The Blazor Smith Chart component will be rendered in the web browser as demonstrated in the following screenshot.

Smith chart Sample

Add series to Smith Chart

Smith Chart series can be added in two ways. You can use either Points or Datasource in the SmithchartSeries tag. Both points and datasource both should be an array of object.

If you add using Datasource property, additionally you need to specify data source mapping fields using Reactance and Resistance properties.

In Points case, you don’t need to specify mapping fields as like in DataSource. But data source fields name should be in ‘resistance’ and ‘reactance’.

The following sample demonstrates adding two series to Smith Chart in both ways.

  • First series Transmission1 shows dataSource bound series.
  • Second series Transmission2 shows points bound series.
@using Syncfusion.EJ2.Blazor.Charts

<EjsSmithchart>
    <SmithchartSeriesCollection>
        <SmithchartSeries
            Name="Transmission1"
            Reactance="reactance"
            Resistance="resistance"
            DataSource="@firstTransmissionSeries">
        </SmithchartSeries>
        <SmithchartSeries
            Name="Transmission2"
            Points="@secondTransmissionSeries">
        </SmithchartSeries>
    </SmithchartSeriesCollection>
</EjsSmithchart>

@code {
    public class SmithDataSource
    {
        public double resistance;
        public double reactance;
    };
    private List<SmithDataSource> firstTransmissionSeries = new List<SmithDataSource> {
        new SmithDataSource { resistance= 10, reactance= 25 },
        new SmithDataSource { resistance= 8, reactance= 6 },
        new SmithDataSource { resistance= 6, reactance= 4.5 },
        new SmithDataSource { resistance= 4.5, reactance= 2 },
        new SmithDataSource { resistance= 3.5, reactance= 1.6 },
        new SmithDataSource { resistance= 2.5, reactance= 1.3 },
        new SmithDataSource { resistance= 2, reactance= 1.2 },
        new SmithDataSource { resistance= 1.5, reactance= 1 },
        new SmithDataSource { resistance= 1, reactance= 0.8 },
        new SmithDataSource { resistance= 0.5, reactance= 0.4 },
        new SmithDataSource { resistance= 0.3, reactance= 0.2 },
        new SmithDataSource { resistance= 0.001, reactance= 0.15 }
    };
    private List<SmithDataSource> secondTransmissionSeries = new List<SmithDataSource> {
        new SmithDataSource { resistance= 20, reactance= -50 },
        new SmithDataSource { resistance= 10, reactance= -10 },
        new SmithDataSource { resistance= 9, reactance= -4.5 },
        new SmithDataSource { resistance= 8, reactance= -3.5 },
        new SmithDataSource { resistance= 7, reactance= -2.5 },
        new SmithDataSource { resistance= 6, reactance= -1.5 },
        new SmithDataSource { resistance= 5, reactance= -1 },
        new SmithDataSource { resistance= 4.5, reactance= -0.5 },
        new SmithDataSource { resistance= 2, reactance= 0.5 },
        new SmithDataSource { resistance= 1.5, reactance= 0.4 },
        new SmithDataSource { resistance= 1, reactance= 0.4 },
        new SmithDataSource { resistance= 0.5, reactance= 0.2 },
        new SmithDataSource { resistance= 0.3, reactance= 0.1 },
        new SmithDataSource { resistance= 0.001, reactance= 0.05 }
    };
}

Smith chart with transmission series

Add title to SmithChart

SmithchartTitle property used to add title for SmithChart. In that Text API used to set text of the title.

<EjsSmithchart>
    <SmithchartTitle Text="Impedance Transmission">
    </SmithchartTitle>
    <SmithchartSeriesCollection>
        <SmithchartSeries Name="Transmission1" Points="@firstTransmissionSeries">
        </SmithchartSeries>
        <SmithchartSeries Name="Transmission2" Points="@secondTransmissionSeries">
        </SmithchartSeries>
    </SmithchartSeriesCollection>
</EjsSmithchart>

Refer code block to know the property value of firstTransmissionSeries and secondTransmissionSeries.

Smith chart with title

Enable marker to Smith Chart

To display marker for particular series, need to set the Visible property to true in SmithchartSeriesMarker. In below sample, marker is enabled for first series only.

<EjsSmithchart>
    <SmithchartTitle Text="Impedance Transmission">
    </SmithchartTitle>
    <SmithchartSeriesCollection>
        <SmithchartSeries Name="Transmission1" Points="@firstTransmissionSeries">
            <SmithchartSeriesMarker Visible="true"></SmithchartSeriesMarker>
        </SmithchartSeries>
        <SmithchartSeries Name="Transmission2" Points="@secondTransmissionSeries">
        </SmithchartSeries>
    </SmithchartSeriesCollection>
</EjsSmithchart>

Refer code block to know the property value of firstTransmissionSeries and secondTransmissionSeries.

Smith chart with marker

Enable data label to Smith Chart marker

To display data label for particular marker series, need to set Visible property to true in SmithchartSeriesDatalabel. In below sample, data label is enabled for first series only.

<EjsSmithchart>
    <SmithchartTitle Text="Impedance Transmission">
    </SmithchartTitle>
    <SmithchartSeriesCollection>
        <SmithchartSeries Name="Transmission1" Points="@firstTransmissionSeries">
            <SmithchartSeriesMarker Visible="true">
                <SmithchartSeriesDatalabel Visible="true"></SmithchartSeriesDatalabel>
            </SmithchartSeriesMarker>
        </SmithchartSeries>
        <SmithchartSeries Name="Transmission2" Points="@secondTransmissionSeries">
        </SmithchartSeries>
    </SmithchartSeriesCollection>
</EjsSmithchart>

Refer code block to know the property value of firstTransmissionSeries and secondTransmissionSeries.

Smith chart with data label and marker

Enable legend for Smith Chart

Smith Chart had a legend feature, which is used to denote the correspond series. To enable the legend, set Visible property value to true in SmithchartLegendSettings.

<EjsSmithchart>
    <SmithchartLegendSettings Visible='true'></SmithchartLegendSettings>
    <SmithchartTitle Text="Impedance Transmission">
    </SmithchartTitle>
    <SmithchartSeriesCollection>
        <SmithchartSeries Name="Transmission1" Points="@firstTransmissionSeries">
            <SmithchartSeriesMarker Visible="true">
                <SmithchartSeriesDatalabel Visible="true"></SmithchartSeriesDatalabel>
            </SmithchartSeriesMarker>
        </SmithchartSeries>
        <SmithchartSeries Name="Transmission2" Points="@secondTransmissionSeries">
        </SmithchartSeries>
    </SmithchartSeriesCollection>
</EjsSmithchart>

Refer code block to know the property value of firstTransmissionSeries and secondTransmissionSeries.

Smith chart with legend

Enable tooltip for Smith Chart Series

The tooltip is useful when you cannot display information by using the data labels due to space constraints. You can enable tooltip by setting the Visible property to true in SmithchartSeriesTooltip.

<EjsSmithchart>
    <SmithchartLegendSettings Visible='true'></SmithchartLegendSettings>
    <SmithchartTitle Text="Impedance Transmission">
    </SmithchartTitle>
    <SmithchartSeriesCollection>
        <SmithchartSeries Name="Transmission1" Points="@firstTransmissionSeries">
            <SmithchartSeriesMarker Visible="true">
                <SmithchartSeriesDatalabel Visible="true"></SmithchartSeriesDatalabel>
            </SmithchartSeriesMarker>
            <SmithchartSeriesTooltip Visible='true'>
            </SmithchartSeriesTooltip>
        </SmithchartSeries>
        <SmithchartSeries Name="Transmission2" Points="@secondTransmissionSeries">
        </SmithchartSeries>
    </SmithchartSeriesCollection>
</EjsSmithchart>

Refer code block to know the property value of firstTransmissionSeries and secondTransmissionSeries.

Smith chart with tooltip

See also