Skip to content

Commit

Permalink
fix(Charts): formatFiat on chart data
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Jun 5, 2018
1 parent 616263a commit 0619bfe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export default (chartData, symbol, history) => {
},
tooltip: {
enabled: total > 0,
valuePrefix: `${symbol}`,
pointFormat: '{point.y}'
pointFormatter: function () {
return symbol + Currency.formatFiat(this.y)
}
},
series: [{
type: 'pie',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Color } from 'blockchain-info-components'
import * as Currency from 'blockchain-wallet-v4/src/exchange/currency'

export const getConfig = (start, interval, currency, data) => ({
chart: {
Expand All @@ -13,7 +14,7 @@ export const getConfig = (start, interval, currency, data) => ({
},
labels: {
formatter: function () {
return (currency + ' ' + this.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','))
return (currency + Currency.formatFiat(this.value))
},
style: {
color: Color('black')
Expand Down Expand Up @@ -45,7 +46,7 @@ export const getConfig = (start, interval, currency, data) => ({
},
tooltip: {
pointFormatter: function () {
return currency + ' ' + this.y.toLocaleString()
return currency + Currency.formatFiat(this.y)
}
},
credits: {
Expand Down

0 comments on commit 0619bfe

Please sign in to comment.