mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Moved render functions into lib/charts.
This commit is contained in:
parent
5a5127c921
commit
3ccdd95f49
6 changed files with 101 additions and 101 deletions
|
|
@ -4,16 +4,12 @@ import classNames from 'classnames';
|
|||
import Chart from 'chart.js/auto';
|
||||
import HoverTooltip from 'components/common/HoverTooltip';
|
||||
import Legend from 'components/metrics/Legend';
|
||||
import { formatLongNumber } from 'lib/format';
|
||||
import useLocale from 'hooks/useLocale';
|
||||
import useTheme from 'hooks/useTheme';
|
||||
import { DEFAULT_ANIMATION_DURATION } from 'lib/constants';
|
||||
import { renderNumberLabels } from 'lib/charts';
|
||||
import styles from './BarChart.module.css';
|
||||
|
||||
function defaultRenderYLabel(label) {
|
||||
return +label > 1000 ? formatLongNumber(label) : label;
|
||||
}
|
||||
|
||||
export function BarChart({
|
||||
datasets,
|
||||
unit,
|
||||
|
|
@ -90,7 +86,7 @@ export function BarChart({
|
|||
},
|
||||
ticks: {
|
||||
color: colors.text,
|
||||
callback: renderYLabel || defaultRenderYLabel,
|
||||
callback: renderYLabel || renderNumberLabels,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue