update market bar

pull/5/head
Miguel Mota 6 years ago
parent 04df158e33
commit 0b40542c37

Binary file not shown.

Before

Width:  |  Height:  |  Size: 678 KiB

After

Width:  |  Height:  |  Size: 634 KiB

Binary file not shown.

@ -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