in community-efforts/prompt_translation/dashboard_template/app.py [0:0]
def kpi_chart_remaining() -> alt.Chart:
"""
This function returns a KPI chart with the remaining amount of records to be annotated.
Returns:
An altair chart with the KPI chart.
"""
pending_records = int(os.getenv("TARGET_RECORDS")) - len(target_dataset)
# Assuming you have a DataFrame with user data, create a sample DataFrame
data = pd.DataFrame({"Category": [PENDING], "Value": [pending_records]})
# Create Altair chart
chart = (
alt.Chart(data)
.mark_text(fontSize=100, align="center", baseline="middle", color="#e68b39")
.encode(text="Value:N")
.properties(title=PENDING, width=250, height=200)
)
return chart