Valentin D. Pinkman
7 years ago
No known key found for this signature in database
GPG Key ID: E7D110669FFB8D3E
3 changed files with
6 additions and
4 deletions
-
src/components/BalanceSummary/index.js
-
src/components/base/Chart/index.js
-
src/components/base/Chart/refreshDraw.js
|
|
@ -61,7 +61,9 @@ const BalanceSummary = ({ |
|
|
|
currency={counterValue} |
|
|
|
tickXScale={selectedTime} |
|
|
|
renderTickY={(val, account) => |
|
|
|
account ? formatCurrencyUnit(account.unit, val) : val |
|
|
|
account |
|
|
|
? formatCurrencyUnit(account.unit, val) |
|
|
|
: formatCurrencyUnit(counterValue.units[0], val) |
|
|
|
} |
|
|
|
renderTooltip={ |
|
|
|
isAvailable && !account |
|
|
|
|
|
@ -59,7 +59,7 @@ export type Props = { |
|
|
|
dateFormat?: string, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
isInteractive?: boolean, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
renderTooltip?: Function, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
renderTickY?: (t: number, account: Account) => mixed, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
renderTickY?: (t: number, account: ?Account) => mixed, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
} |
|
|
|
|
|
|
|
class Chart extends PureComponent<Props> { |
|
|
@ -72,7 +72,7 @@ class Chart extends PureComponent<Props> { |
|
|
|
isInteractive: true, |
|
|
|
tickXScale: 'month', |
|
|
|
renderTickY: (t: number, account: Account): mixed => |
|
|
|
account ? formatShort(account.unit, t) : t, |
|
|
|
account ? formatShort(account.unit, t) : '', |
|
|
|
} |
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
|
|
@ -87,7 +87,7 @@ export default function refreshDraw({ ctx, props }: { ctx: CTX, props: Props }) |
|
|
|
d3 |
|
|
|
.axisLeft(y) |
|
|
|
.ticks(3) |
|
|
|
.tickFormat(val => (renderTickY && account ? renderTickY(val, account) : val)), |
|
|
|
.tickFormat(val => renderTickY(val, account)), |
|
|
|
) |
|
|
|
NODES.axisBot.call( |
|
|
|
d3 |
|
|
|