Loading...
Loading...
Compare original and translation side by side
@syncfusion/ej2-react-charts@syncfusion/ej2-react-chartsimport * as React from 'react';
import { SmithchartComponent, SeriesCollectionDirective, SeriesDirective, Inject, SmithchartLegend, TooltipRender } from '@syncfusion/ej2-react-charts';
function App() {
const transmissionData = [
{ resistance: 0, reactance: 0.05 },
{ resistance: 0, reactance: 0.1 },
{ resistance: 0, reactance: 0.2 },
{ resistance: 0.3, reactance: 0.3 },
{ resistance: 0.5, reactance: 0.4 },
{ resistance: 1.0, reactance: 0.5 }
];
return (
<SmithchartComponent
id="smithchart"
title={{ text: 'Transmission Line Impedance' }}
legendSettings={{ visible: true }}
>
<Inject services={[SmithchartLegend, TooltipRender]} />
<SmithChartSeriesCollectionDirective>
<SmithChartSeriesDirective
name="Transmission1"
points={transmissionData}
marker={{ visible: true }}
tooltip={{ visible: true }}
/>
</SeriesCollectionDirective>
</SmithchartComponent>
);
}
export default App;import * as React from 'react';
import { SmithchartComponent, SeriesCollectionDirective, SeriesDirective, Inject, SmithchartLegend, TooltipRender } from '@syncfusion/ej2-react-charts';
function App() {
const transmissionData = [
{ resistance: 0, reactance: 0.05 },
{ resistance: 0, reactance: 0.1 },
{ resistance: 0, reactance: 0.2 },
{ resistance: 0.3, reactance: 0.3 },
{ resistance: 0.5, reactance: 0.4 },
{ resistance: 1.0, reactance: 0.5 }
];
return (
<SmithchartComponent
id="smithchart"
title={{ text: 'Transmission Line Impedance' }}
legendSettings={{ visible: true }}
>
<Inject services={[SmithchartLegend, TooltipRender]} />
<SmithChartSeriesCollectionDirective>
<SmithChartSeriesDirective
name="Transmission1"
points={transmissionData}
marker={{ visible: true }}
tooltip={{ visible: true }}
/>
</SmithChartSeriesCollectionDirective>
</SmithchartComponent>
);
}
export default App;const series1Data = [
{ resistance: 0, reactance: 0.05 },
{ resistance: 0.3, reactance: 0.2 },
{ resistance: 1.0, reactance: 0.4 }
];
const series2Data = [
{ resistance: 0.1, reactance: 0.1 },
{ resistance: 0.5, reactance: 0.3 },
{ resistance: 1.5, reactance: 0.5 }
];
<SmithchartComponent legendSettings={{ visible: true }}>
<Inject services={[SmithchartLegend]} />
<SmithChartSeriesCollectionDirective>
<SmithChartSeriesDirective
name="Line 1"
dataSource={series1Data}
resistance="resistance"
reactance="reactance"
fill="blue"
/>
<SmithChartSeriesDirective
name="Line 2"
dataSource={series2Data}
resistance="resistance"
reactance="reactance"
fill="red"
/>
</SeriesCollectionDirective>
</SmithchartComponent>const series1Data = [
{ resistance: 0, reactance: 0.05 },
{ resistance: 0.3, reactance: 0.2 },
{ resistance: 1.0, reactance: 0.4 }
];
const series2Data = [
{ resistance: 0.1, reactance: 0.1 },
{ resistance: 0.5, reactance: 0.3 },
{ resistance: 1.5, reactance: 0.5 }
];
<SmithchartComponent legendSettings={{ visible: true }}>
<Inject services={[SmithchartLegend]} />
<SmithChartSeriesCollectionDirective>
<SmithChartSeriesDirective
name="Line 1"
dataSource={series1Data}
resistance="resistance"
reactance="reactance"
fill="blue"
/>
<SmithChartSeriesDirective
name="Line 2"
dataSource={series2Data}
resistance="resistance"
reactance="reactance"
fill="red"
/>
</SmithChartSeriesCollectionDirective>
</SmithchartComponent><SmithChartSeriesDirective
name="Impedance Data"
points={data}
marker={{
visible: true,
height: 10,
width: 10,
shape: 'Diamond',
fill: 'green',
dataLabel: {
visible: true,
textStyle: { color: 'black', size: '10px' }
}
}}
/><SmithChartSeriesDirective
name="Impedance Data"
points={data}
marker={{
visible: true,
height: 10,
width: 10,
shape: 'Diamond',
fill: 'green',
dataLabel: {
visible: true,
textStyle: { color: 'black', size: '10px' }
}
}}
/>import { useRef } from 'react';
function ChartWithExport() {
const chartRef = useRef(null);
const exportChart = () => {
chartRef.current.export('PNG', 'smithchart');
};
return (
<>
<button onClick={exportChart}>Export as PNG</button>
<SmithchartComponent ref={chartRef} id="smithchart">
{/* series configuration */}
</SmithchartComponent>
</>
);
}import { useRef } from 'react';
function ChartWithExport() {
const chartRef = useRef(null);
const exportChart = () => {
chartRef.current.export('PNG', 'smithchart');
};
return (
<>
<button onClick={exportChart}>Export as PNG</button>
<SmithchartComponent ref={chartRef} id="smithchart">
{/* series configuration */}
</SmithchartComponent>
</>
);
}| Property | Type | Description |
|---|---|---|
| string | Unique identifier for the component |
| object | Title configuration with text and styling |
| object | Legend visibility, position, and styling |
| string | Chart width (pixels or percentage) |
| string | Chart height (pixels or percentage) |
| object | Horizontal axis configuration |
| object | Radial axis configuration |
| 属性 | 类型 | 说明 |
|---|---|---|
| string | 组件唯一标识符 |
| object | 标题配置,包含文本和样式 |
| object | 图例可见性、位置和样式配置 |
| string | 图表宽度(像素或百分比) |
| string | 图表高度(像素或百分比) |
| object | 水平轴配置 |
| object | 径向轴配置 |
| Property | Type | Description |
|---|---|---|
| string | Series name for legend display |
| array | Array of {resistance, reactance} objects |
| array | Data array with custom field mapping |
| string | Field name for resistance values |
| string | Field name for reactance values |
| string | Series line color |
| number | Series line width |
| number | Series line opacity (0-1) |
| object | Marker configuration |
| object | Tooltip configuration |
| boolean | Smart label positioning |
| 属性 | 类型 | 说明 |
|---|---|---|
| string | 系列名称,用于图例显示 |
| array | {resistance, reactance}对象数组 |
| array | 自定义字段映射的数据数组 |
| string | 电阻值对应的字段名 |
| string | 电抗值对应的字段名 |
| string | 系列线条颜色 |
| number | 系列线条宽度 |
| number | 系列线条透明度(0-1) |
| object | 标记配置 |
| object | 工具提示配置 |
| boolean | 智能标签定位开关 |
import { SmithchartLegend, TooltipRender } from '@syncfusion/ej2-react-charts';
<Inject services={[SmithchartLegend, TooltipRender]} />import { SmithchartLegend, TooltipRender } from '@syncfusion/ej2-react-charts';
<Inject services={[SmithchartLegend, TooltipRender]} />@syncfusion/ej2-react-chartsresistancereactance@syncfusion/ej2-react-chartsresistancereactancelegendSettings.visibletrueSmithchartLegendnamelegendSettings.visibletrueSmithchartLegendnameTooltipRendertooltip.visibletrueTooltipRendertooltip.visibletrueidid