Fix bug Real Time Performance (#1454)

* Fix bug percentage Real time performance

* Update ticker format

* Update tests

Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com>
Co-authored-by: jmaslek <jmaslek11@gmail.com>
This commit is contained in:
minhhoang1023
2022-03-13 01:24:24 +07:00
committed by GitHub
parent 4936177526
commit dbaa3ecb41
3 changed files with 26 additions and 22 deletions

View File

@@ -5,6 +5,7 @@ from typing import List, Optional
import logging
import os
import matplotlib
import matplotlib.pyplot as plt
from gamestonk_terminal.decorators import check_api_key
from gamestonk_terminal.config_terminal import theme
@@ -48,6 +49,8 @@ def realtime_performance_sector(
# pylint: disable=invalid-sequence-index
df_rtp = df_sectors["Rank A: Real-Time Performance"]
df_rtp = df_rtp.apply(lambda x: x * 100)
if raw:
print_rich_table(
df_rtp.to_frame(),
@@ -61,6 +64,7 @@ def realtime_performance_sector(
theme.style_primary_axis(ax)
ax.set_title("Real Time Performance (%) per Sector")
ax.tick_params(axis="x", labelrotation=90)
ax.xaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter("%.2f"))
if external_axes is None:
theme.visualize_output()

View File

@@ -1,12 +1,12 @@
Rank A: Real-Time Performance
Consumer Staples 0.0002
Real Estate -0.0004
Utilities -0.0018
Industrials -0.0097
Health Care -0.0106
Information Technology -0.0193
Energy -0.0195
Financials -0.0202
Materials -0.0249
Consumer Discretionary -0.0310
Communication Services -0.0388
Consumer Staples 0.02
Real Estate -0.04
Utilities -0.18
Industrials -0.97
Health Care -1.06
Information Technology -1.93
Energy -1.95
Financials -2.02
Materials -2.49
Consumer Discretionary -3.10
Communication Services -3.88

View File

@@ -1,12 +1,12 @@
Rank A: Real-Time Performance
Consumer Staples 0.0002
Real Estate -0.0004
Utilities -0.0018
Industrials -0.0097
Health Care -0.0106
Information Technology -0.0193
Energy -0.0195
Financials -0.0202
Materials -0.0249
Consumer Discretionary -0.0310
Communication Services -0.0388
Consumer Staples 0.02
Real Estate -0.04
Utilities -0.18
Industrials -0.97
Health Care -1.06
Information Technology -1.93
Energy -1.95
Financials -2.02
Materials -2.49
Consumer Discretionary -3.10
Communication Services -3.88