AverageSession

AverageSession() → {JSX.Element}

Component that displays a chart showing the average sessions.

Properties
NameTypeDescription
sessionDataObject

The props passed to the component.

Properties
NameTypeDescription
isLoadingboolean

False if all the data have been fetched

dataArray.<object>

An array of objects containing data for the chart. {day: string, sessionLength: number}

data[].daystring

Day of the week of the activity

data[].sessionLengthnumber

Length of the activity

See
Returns:

A JSX element containing a LineChart element from the recharts library.

Type: 
JSX.Element
Example
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.

Returns:

A JSX element representing the custom legend.

Type: 
JSX.Element

(inner) TooltipSession() → {null|JSX.Element}

Displays a custom tooltip for a chart.

Properties
NameTypeDescription
activeboolean

Whether or not the tooltip is active.

payloadArray

An array of objects containing data for the chart.

Returns:

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
Example
return{
 <TooltipSession />
}