Browse Source

placeholder for graph

master
Gaëtan Renaudeau 7 years ago
parent
commit
3c43e899fa
  1. 19
      src/components/BalanceSummary/index.js

19
src/components/BalanceSummary/index.js

@ -56,12 +56,25 @@ const BalanceSummary = ({
<Chart
id={chartId}
unit={account ? account.unit : null}
color={!isAvailable ? 'transparent' : chartColor}
data={balanceHistory}
color={!isAvailable ? '#eee' : chartColor}
data={
isAvailable
? balanceHistory
: balanceHistory.map(i => ({
...i,
value:
10000 *
(1 +
0.1 * Math.sin(i.date * Math.cos(i.date)) + // random-ish
0.5 * Math.cos(i.date / 2000000000 + Math.sin(i.date / 1000000000))), // general curve trend
}))
}
height={200}
currency={counterValue}
tickXScale={selectedTimeRange}
renderTickY={val => formatShort(counterValue.units[0], val)}
renderTickY={
isAvailable ? val => formatShort(counterValue.units[0], val) : () => ''
}
isInteractive={isAvailable}
renderTooltip={
isAvailable && !account

Loading…
Cancel
Save