start and end dates can be updated on stats graph
This commit is contained in:
@ -2,8 +2,14 @@ import React from 'react'
|
||||
|
||||
import { formatValue } from '../../../utils/stats'
|
||||
|
||||
/**
|
||||
* @return {null}
|
||||
*/
|
||||
export default function CustomLabel (props) {
|
||||
const { displayedData, x, y, width, value } = props
|
||||
if (!value) {
|
||||
return null
|
||||
}
|
||||
const radius = 10
|
||||
const formattedValue = formatValue(displayedData, value)
|
||||
|
||||
|
@ -79,6 +79,9 @@ export default class StatsCharts extends React.PureComponent {
|
||||
/>
|
||||
{sports.map((s, i) => (
|
||||
<Bar
|
||||
// disable for now due to problems w/ CustomLabel
|
||||
// see https://github.com/recharts/recharts/issues/829
|
||||
isAnimationActive={false}
|
||||
key={s.id}
|
||||
dataKey={s.label}
|
||||
stackId="a"
|
||||
|
@ -30,8 +30,10 @@ class Statistics extends React.PureComponent {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { displayedSports, sports, statistics, statsParams } = this.props
|
||||
if (Object.keys(statistics).length === 0) {
|
||||
const {
|
||||
displayedSports, sports, statistics, statsParams, displayEmpty
|
||||
} = this.props
|
||||
if (!displayEmpty && Object.keys(statistics).length === 0) {
|
||||
return 'No workouts'
|
||||
}
|
||||
const stats = formatStats(statistics, sports, statsParams, displayedSports)
|
||||
|
Reference in New Issue
Block a user