AverageSession() → {JSX.Element}
Component that displays a chart showing the average sessions.
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sessionData | Object | The props passed to the component. Properties
|
- See
- https://recharts.org/en-US/api/LineChart for further information on `LineChart` element from recharts api
A JSX element containing a LineChart
element from the recharts
library.
- Type:
- JSX.
Element
const userSessions = {isLoading: false, data[{day:1, sessionLength: 30},...]}
return (
<AverageSession sessionData={userSessions} />
)
Methods
(inner) LegendSession() → {JSX.Element}
Displays a custom legend for a chart.
A JSX element representing the custom legend.
- Type:
- JSX.
Element
(inner) TooltipSession() → {null|JSX.Element}
Displays a custom tooltip for a chart.
Name | Type | Description |
---|---|---|
active | boolean | Whether or not the tooltip is active. |
payload | Array | An array of objects containing data for the chart. |
A JSX element representing the custom tooltip. If the active
property is true
and the payload
array exists and is not empty, the element is a list element containing the text returned by the TooltipText
function.
- Type:
- null |
JSX. Element
return{
<TooltipSession />
}