mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Refactor components. Add refresh button.
This commit is contained in:
parent
d0ca0819c6
commit
d06c077019
12 changed files with 85 additions and 56 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import React from 'react';
|
||||
import CheckVisible from 'components/helpers/CheckVisible';
|
||||
import BarChart from './BarChart';
|
||||
import { getDateLength } from '../../lib/date';
|
||||
|
||||
export default function PageviewsChart({ websiteId, data, unit, className }) {
|
||||
export default function PageviewsChart({ websiteId, data, startDate, endDate, unit, className }) {
|
||||
const handleUpdate = chart => {
|
||||
const {
|
||||
data: { datasets },
|
||||
|
|
@ -43,7 +44,7 @@ export default function PageviewsChart({ websiteId, data, unit, className }) {
|
|||
},
|
||||
]}
|
||||
unit={unit}
|
||||
records={data.pageviews.length}
|
||||
records={getDateLength(startDate, endDate, unit)}
|
||||
animationDuration={visible ? 300 : 0}
|
||||
onUpdate={handleUpdate}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue