Activity

Activity() → {JSX.Element}

Component that displays a chart showing daily activity.

Properties
NameTypeDescription
dataActivityObject

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: number, kilogram: number, calories:number}

data[].daynumber

Day's number of the activity

data[].kilogramnumber

Kilogram of the activity

data[].caloriesnumber

Calories of the activity

See
Returns:

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

Type: 
JSX.Element
Example
const dataActivity = {isLoading: false, data[{day:1, kilogram: 80, calories:240},...]}
return (
 <Activity dataActivity={userActivity} />
)

Methods

(inner) LegendCustom() → {JSX.Element}

Displays a custom legend for a chart.

Returns:

A JSX element representing the custom legend.

Type: 
JSX.Element
Example
return{
 <LegendCustom />
}

(inner) SpecialTooltip() → {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{
 <SpecialTooltip />
}