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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user