import React from 'react'; import { Loader, NoContent } from 'UI'; import { widgetHOC, Styles } from '../common'; import { ComposedChart, Bar, CartesianGrid, Line, Legend, ResponsiveContainer, XAxis, YAxis, Tooltip } from 'recharts'; import { LAST_24_HOURS, LAST_30_MINUTES, YESTERDAY, LAST_7_DAYS } from 'Types/app/period'; const customParams = rangeName => { const params = { density: 30 } if (rangeName === LAST_24_HOURS) params.density = 24 if (rangeName === LAST_30_MINUTES) params.density = 18 if (rangeName === YESTERDAY) params.density = 24 if (rangeName === LAST_7_DAYS) params.density = 30 return params } @widgetHOC('resourceTypeVsResponseEnd', { customParams }) export default class ResourceLoadedVsResponseEnd extends React.PureComponent { render() { const { data, loading, compare = false, showSync = false } = this.props; const colors = compare ? Styles.compareColors : Styles.colors; return ( Styles.tickFormatter(val, 'ms')} yAxisId="left" /> Styles.tickFormatter(val, 'ms')} label={{ ...Styles.axisLabelLeft, offset: 70, value: "Response End (ms)" }} yAxisId="right" orientation="right" /> ); } }