Merge pull request #237 from lyricnz/bugfix/hide-portfolio-balances

Fix bug with chart Y axis still showing when hidePortfolioBalances
pull/259/head
Miguel Mota 3 years ago committed by GitHub
commit f34eb3ef8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -315,10 +315,15 @@ func (ct *Cointop) PortfolioChart() error {
// Scale Portfolio Balances to hide value
if ct.State.hidePortfolioBalances {
var lastPrice = data[len(data)-1]
if lastPrice > 0.0 {
scalePrice := 0.0
for _, price := range data {
if price > scalePrice {
scalePrice = price
}
}
if scalePrice > 0.0 {
for i, price := range data {
data[i] = 100 * price / lastPrice
data[i] = 100 * price / scalePrice
}
}
}

Loading…
Cancel
Save