update market bar

Former-commit-id: bf278c6f0219645df4f543a619fc46e908b39873 [formerly bf278c6f0219645df4f543a619fc46e908b39873 [formerly 1ba22121f131b82d665ccf231c918a8b2f4f315c [formerly 0b40542c37]]]
Former-commit-id: d8d1e27350c0728f92ae50c3b62fe3da0b1562ae
Former-commit-id: f84ec05bb7ac6302aa2ac667aabb1a1c56c504bc [formerly 4d3b016519fd8d7b34e0480788cb675fe02d12f6]
Former-commit-id: 3d7f797676177b9e5d3201182e500a069b2a532f
pull/15/head
Miguel Mota 6 years ago
parent 5f3be003ec
commit 04438e9a3c

@ -1 +1 @@
6e9487c3af66a8004e286b72d88983e1a690e5e2
04931e1a15e87c267913b1cc423c4158c7ee9516

@ -1 +1 @@
b4645e922bfc9c74e735b9b7e16669cf82966cf5
e2cadd20933e4749d97ec2e29b5d52f2a096b598

@ -34,7 +34,7 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error {
now := time.Now()
secs := now.Unix()
start := secs - oneDay
start := secs - oneWeek
end := secs
_ = coin
@ -52,7 +52,7 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error {
}
*/
for i := range graphData.MarketCapByAvailableSupply {
data = append(data, graphData.MarketCapByAvailableSupply[i][1])
data = append(data, graphData.MarketCapByAvailableSupply[i][1]/1E9)
}
chart.Data = data
termui.Body = termui.NewGrid()

@ -14,6 +14,7 @@ func (ct *Cointop) updateMarket() error {
if err != nil {
return err
}
fmt.Fprintln(ct.marketview, pad.Right(fmt.Sprintf("%s Total Market Cap: %s • 24H Volume: %s • BTC Dominance: %.2f%% • Active Currencies: %s • Active Assets: %s • Active Markets: %s", color.Cyan("cointop"), color.WhiteBold(humanize.Commaf(market.TotalMarketCapUSD)), humanize.Commaf(market.Total24HVolumeUSD), market.BitcoinPercentageOfMarketCap, humanize.Comma(int64(market.ActiveCurrencies)), humanize.Comma(int64(market.ActiveAssets)), humanize.Comma(int64(market.ActiveMarkets))), maxX, " "))
timeframe := "7 Day"
fmt.Fprintln(ct.marketview, pad.Right(fmt.Sprintf("%s Chart: %s • Total Market Cap: %s • 24H Volume: %s • BTC Dominance: %.2f%% • Active Currencies: %s • Active Markets: %s", color.Cyan("cointop"), timeframe, color.WhiteBold(humanize.Commaf(market.TotalMarketCapUSD)), humanize.Commaf(market.Total24HVolumeUSD), market.BitcoinPercentageOfMarketCap, humanize.Comma(int64(market.ActiveCurrencies)), humanize.Comma(int64(market.ActiveMarkets))), maxX, " "))
return nil
}

Loading…
Cancel
Save