Change() {
let data = [
{ resistance: 20, reactance: -50 },
// Add more data
];
this.smithchartInstance.series[0].points = data;
this.smithchartInstance.refresh();
} |
class App extends Component<AppProps, AppState> {
private smithchartInstance: SmithchartComponent;
constructor(props) {
super(props);
this.state = {
name: "React"
};
}
Change() {
let data = [
{ resistance: 20, reactance: -50 },
// More data
];
this.smithchartInstance.series[0].points = data;
this.smithchartInstance.refresh();
}
render() {
return (
<div>
<button id="click" onClick={this.Change.bind(this)}>
Click to Change data
</button>
<SmithchartComponent
id="smith-chart"
ref={gauge => (this.smithchartInstance = gauge)}
>
// Add more codes
</SmithchartComponent>
</div>
);
}
} |
ref={gauge => (this.smithchartInstance = gauge as SmithchartComponent)}
|
<SmithchartSeriesCollectionDirective>
<SmithchartSeriesDirective
fill= 'transparent'
name="Transmission1"
marker={{
shape: "Circle",
visible: true,
fill: 'red',
border: { width: 2 }
}}
/>
</SmithchartSeriesCollectionDirective>
</SmithchartComponent> |
loaded(args) {
let element = document.getElementById('smith-chart_series0_points');
element.setAttribute('stroke', 'transparent');
}
|
<SmithchartComponent background="transparent"/>
</SmithchartComponent> |
<SmithchartComponent
horizontalAxis={{
majorGridLines:{color: ‘white’},
axisLine:{color: ‘white’},
labelStyle:{ color: ‘white’ }
}}
radialAxis={{
majorGridLines:{color: ‘white’},
axisLine:{color: ‘white’},
labelStyle:{ color: ‘white’ }
}} />
</SmithchartComponent> |