feat: #345 even if the backend data returns empty, the skeleton of the chart will be displayed. (#461)

… chart will be displayed.

### What problem does this PR solve?

feat: #345 even if the backend data returns empty, the skeleton of the
chart will be displayed.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-04-19 19:05:30 +08:00
committed by GitHub
parent 7da3f88e54
commit c055f40dff
8 changed files with 45 additions and 31 deletions

View File

@@ -50,9 +50,10 @@ const data = [
interface IProps extends CategoricalChartProps {
data?: Array<{ xAxis: string; yAxis: number }>;
showLegend?: boolean;
}
const RagLineChart = ({ data }: IProps) => {
const RagLineChart = ({ data, showLegend = false }: IProps) => {
return (
<ResponsiveContainer width="100%" height="100%">
<LineChart
@@ -72,7 +73,7 @@ const RagLineChart = ({ data }: IProps) => {
<XAxis dataKey="xAxis" />
<YAxis />
<Tooltip />
<Legend />
{showLegend && <Legend />}
<Line
type="monotone"
dataKey="yAxis"