Skip to content

Color parameter in Plotly express doesn't adjust with dynamic selection. #2968

@RammySekham

Description

@RammySekham

I have dynamic dropdown list, which sets the color of labels for the graph.But when selection has one element in it throws an error, otherwise it works fine.

app_graph2`=px.scatter(df, x="MAX_TEMP", y="DEMAND", color="STATE", title='Scatter Plot Demand Vs Maximum Temperature')

I have dcc.dropdown for STATE with multi=True, it throws error, when user selects one state.

      plotly\express\_chart_types.py", line 252, in line
      return make_figure(args=locals(), constructor=g
      o.Scatter)

      plotly\express\_core.py", line 1852, in make_figure
      for val in sorted_group_values[m.grouper]:

Is there any alternative to resolve it ?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions