import React, { useState } from 'react'; import { formatTimeOrDate } from 'App/date'; import { Button, Table } from 'antd'; import type { TableProps } from 'antd'; import CustomTooltip from "../CustomChartTooltip"; import { Eye, EyeOff } from 'lucide-react'; import { Styles } from '../../common'; import { ResponsiveContainer, XAxis, YAxis, CartesianGrid, Tooltip, LineChart, Line, Legend, } from 'recharts'; import cn from 'classnames'; interface Props { data: any; compData: any | null; params: any; colors: any; onClick?: (event, index) => void; yaxis?: any; label?: string; hideLegend?: boolean; inGrid?: boolean; } function CustomMetricLineChart(props: Props) { const { data = { chart: [], namesMap: [] }, compData = { chart: [], namesMap: [] }, params, colors, onClick = () => null, yaxis = { ...Styles.yaxis }, label = 'Number of Sessions', hideLegend = false, inGrid, } = props; const resultChart = data.chart.map((item, i) => { if (compData && compData.chart[i]) return { ...compData.chart[i], ...item } return item }) return ( {!hideLegend && ( )} Styles.tickFormatter(val)} label={{ ...Styles.axisLabelLeft, value: label || 'Number of Sessions', }} /> {Array.isArray(data.namesMap) && data.namesMap.map((key, index) => key ? ( ) : null)} {compData?.namesMap.map((key, i) => data.namesMap[i] ? ( ) : null)} ); } export default CustomMetricLineChart;