Loading...
Loading...
Implement Syncfusion Angular Smith Chart component for high-frequency circuit visualization and transmission line analysis. Use this skill whenever the user needs to create smith charts, visualize impedance or admittance parameters, add multiple series to a smith chart, customize axes and gridlines, configure markers and data labels, implement legends with visibility toggling, add tooltips and export functionality, or styling and accessibility. Covers installation, basic rendering, series management, axis configuration, marker/label customization, legend setup and advanced features.
npx skill4agent add syncfusion/angular-ui-components-skills syncfusion-angular-smith-chartImpedanceAdmittancepointsdataSourceresistancereactanceimport { SmithchartModule } from '@syncfusion/ej2-angular-charts'
import { Component } from '@angular/core';
@Component({
imports: [SmithchartModule],
standalone: true,
selector: 'app-container',
template: `<ejs-smithchart
id='smithchart-container'
[series]="series">
</ejs-smithchart>`
})
export class AppComponent {
series = [{
points: [
{ resistance: 10, reactance: 10 },
{ resistance: 20, reactance: 15 },
{ resistance: 30, reactance: 5 },
{ resistance: 40, reactance: -5 },
{ resistance: 50, reactance: -15 }
]
}]
}series = [
{
name: 'Transmission Line A',
points: [
{ resistance: 0.2, reactance: 0.1 },
{ resistance: 0.5, reactance: 0.3 },
{ resistance: 1.0, reactance: 0.5 }
],
fill: '#0066CC',
marker: { visible: true },
tooltip: { visible: true }
},
{
name: 'Transmission Line B',
points: [
{ resistance: 0.3, reactance: 0.15 },
{ resistance: 0.6, reactance: 0.4 },
{ resistance: 1.2, reactance: 0.6 }
],
fill: '#FF6633',
marker: { visible: true },
tooltip: { visible: true }
}
]@Component({
template: `
<ejs-smithchart [series]="series" [legendSettings]="legendSettings">
</ejs-smithchart>
`
})
export class AppComponent {
series = [
{
name: 'Device A',
marker: {
visible: true,
shape: 'Circle',
width: 8,
height: 8,
dataLabel: { visible: true } // ✓ dataLabel INSIDE marker
},
tooltip: { visible: true, template: 'R:${resistance}+jX:${reactance}' },
points: [...]
}
];
legendSettings = {
visible: true,
position: 'Bottom',
alignment: 'Center'
};
}@Component({
template: `
<ejs-smithchart
[series]="series"
[horizontalAxis]="hAxis"
[radialAxis]="rAxis">
</ejs-smithchart>
`
})
export class AppComponent {
series = [
{
points: [...],
renderType: 'Admittance'
}
];
hAxis = {
labelPosition: 'Outside',
majorGridlines: { visible: true, width: 1, opacity: 0.8 },
minorGridlines: { visible: true, count: 4, opacity: 0.4 }
};
rAxis = {
majorGridlines: { visible: true, width: 1, opacity: 0.8 },
minorGridlines: { visible: true, count: 4, opacity: 0.4 }
};
}series = [
{
name: 'Test Results',
dataSource: [
{ impedance: 50, phase: 0 }, // Will be mapped to resistance/reactance
{ impedance: 75, phase: 15 },
{ impedance: 100, phase: 30 }
],
resistance: 'impedance',
reactance: 'phase'
}
];@Component({
template: `
<div>
<button (click)="exportChart('PNG')">Export PNG</button>
<button (click)="exportChart('SVG')">Export SVG</button>
<button (click)="printChart()">Print</button>
</div>
<ejs-smithchart #smithchart [series]="series"></ejs-smithchart>
`
})
export class AppComponent {
@ViewChild('smithchart') smithchart!: any;
exportChart(format: string) {
this.smithchart.export(format, 'smith-chart-export');
}
printChart() {
this.smithchart.print();
}
}
## Import Best Practices
### ✅ Minimal Imports (Most Cases)
For basic smith charts without advanced features, import only what you need:
```typescript
import { SmithchartModule } from '@syncfusion/ej2-angular-charts'
import { Component, ViewEncapsulation } from '@angular/core'
@Component({
imports: [SmithchartModule], // ✓ Only SmithchartModule needed
standalone: true,
encapsulation: ViewEncapsulation.None,
template: `<ejs-smithchart [series]="series"></ejs-smithchart>`
})
export class AppComponent {
series = [{ points: [...] }]
}// ✗ WRONG - CommonModule not needed in standalone component
import { CommonModule } from '@angular/common'
@Component({
imports: [SmithchartModule, CommonModule], // CommonModule is unnecessary
standalone: true
})
// ✗ WRONG - SmithchartLegendService not needed without custom legend events
import { SmithchartLegendService } from '@syncfusion/ej2-angular-charts'
@Component({
providers: [SmithchartLegendService], // Only for custom legend click handling
standalone: true
})
export class AppComponent {
legendSettings = { visible: true } // Basic legend doesn't need the service
}
// ✗ WRONG - TooltipRenderService not needed without tooltips
import { TooltipRenderService } from '@syncfusion/ej2-angular-charts'
@Component({
providers: [TooltipRenderService], // Only needed if tooltip: { visible: true }
standalone: true
})
export class AppComponent {
series = [{ points: [...] }] // No tooltip configuration
}| Use Case | Service | Import |
|---|---|---|
| Basic chart | None | Only |
| With tooltips | | Add when using |
| Advanced legend clicks | | Add when handling legend interaction events |
import { SmithchartModule, TooltipRenderService } from '@syncfusion/ej2-angular-charts'
@Component({
imports: [SmithchartModule],
providers: [TooltipRenderService], // ✓ Add only if using tooltips
standalone: true
})
export class AppComponent {
series = [{
points: [
{ resistance: 0.2, reactance: 0.1 },
{ resistance: 0.4, reactance: 0.3 }
],
tooltip: { visible: true } // ✓ Tooltips are configured
}]
}| Property | Type | Default | Purpose |
|---|---|---|---|
| Array | | Array of series with points data for visualization |
| Array | - | Data array for a series (resistance, reactance pairs) |
| Array | - | Bind data from external source or data array |
| string | - | Property name for X-axis value (resistance) from dataSource |
| string | - | Property name for Y-axis value (reactance) from dataSource |
| string | - | Series name for legend display |
| string | | Render type: |
| string | - | Series line color (hex or named color) |
| number | 2 | Series line width in pixels |
| number | 1 | Series line opacity (0-1) |
| object | - | Marker configuration (visible, shape, size) |
| object | - | Data label configuration (visible, format) |
| object | - | Tooltip configuration (visible, format, template) |
| object | - | Title configuration (text, visible, styling) |
| string/number | '400px' | Chart height (px or percentage) |
| string/number | '100%' | Chart width (px or percentage) |
| string | | Built-in theme (Material, Bootstrap, Tailwind, etc.) |
| object | - | Legend configuration (visible, position, alignment) |
| object | - | Horizontal axis customization and labels |
| object | - | Radial axis customization and gridlines |
| boolean | | Enable right-to-left text direction support |
| string | - | Accessibility label for screen readers |
Smithchartreferences