import React from 'react' import { Styles } from '../../common'; import { AreaChart, ResponsiveContainer, XAxis, YAxis, CartesianGrid, Area, Tooltip } from 'recharts'; import { LineChart, Line, Legend } from 'recharts'; import cn from 'classnames'; import CountBadge from '../../common/CountBadge'; import { numberWithCommas } from 'App/utils'; interface Props { data: any; // onClick?: (event, index) => void; } function CustomMetricOverviewChart(props: Props) { const { data } = props; const gradientDef = Styles.gradientDef(); return (
{gradientDef}
) } export default CustomMetricOverviewChart const countView = (avg, unit) => { if (unit === 'mb') { if (!avg) return 0; const count = Math.trunc(avg / 1024 / 1024); return numberWithCommas(count); } if (unit === 'min') { if (!avg) return 0; const count = Math.trunc(avg); return numberWithCommas(count > 1000 ? count +'k' : count); } return avg ? numberWithCommas(avg): 0; }