-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
I have a bar chart with a facet_row
defined as follows, with example data.
Example code and data for `facet_row` bug
tmp_data = [
{
"date": "2022-04-17",
"role_name": "Nurse",
"work_type": "Cleaning",
"daily_total_minutes": 45,
"percent_of_daily_role_total_minutes": 0.41,
},
{
"date": "2022-04-17",
"role_name": "Nurse",
"work_type": "Food preparation",
"percent_of_daily_role_total_minutes": 0.59,
},
{
"date": "2022-04-17",
"role_name": "Volunteer",
"work_type": "Cleaning",
"percent_of_daily_role_total_minutes": 0.26,
},
{
"date": "2022-04-17",
"role_name": "Volunteer",
"work_type": "Food preparation",
"percent_of_daily_role_total_minutes": 0.74,
},
{
"date": "2022-05-06",
"role_name": "Volunteer",
"work_type": "Food preparation",
"percent_of_daily_role_total_minutes": 1.0,
},
{
"date": "2022-05-07",
"role_name": "Volunteer",
"work_type": "Cleaning",
"percent_of_daily_role_total_minutes": 0.49,
},
{
"date": "2022-05-07",
"role_name": "Volunteer",
"work_type": "Food preparation",
"percent_of_daily_role_total_minutes": 0.51,
},
]
daily_work_by_caregiver_role_and_type_with_percent_chart = px.bar(
tmp_data,
x="date",
y="percent_of_daily_role_total_minutes",
facet_row="role_name",
color="work_type",
title=_("Daily work percent by caregiver role and work type"),
labels={
"role_name": _("Caregiver role"),
"percent_of_daily_role_total_minutes": _("Work percent"),
"work_type": _("Type of work"),
},
text_auto=True,
)
daily_work_by_caregiver_role_and_type_with_percent_chart.layout.yaxis.tickformat = ",.0%"
# render the chart
daily_work_by_caregiver_role_and_type_with_percent_chart.to_html()
When rendering the chart, the x axis correctly determines the data are dates and the y-axis on the bottom facet is correctly formatted as a percentage with the data rendering. However, the top facet doesn't render any data.
I have tried both with and without specifying the yaxis.tickformat
and get a similar result, where the first facet series doesn't render any data.
Metadata
Metadata
Assignees
Labels
No labels