As it says in the title - I have made a bubble chart which displays the filed time of a single football player in every game. The player is previously selected from the dropdown menu. My problem is to get the highest number from the [FieldTime] column and represent the values on the chart as the percentage of this value. I've tried calculating the highest value using pandas, but without success. It's my first project, and I'm a bit lost right now.
Graph code:
def build_graph(player):
dff = activities[(activities['Name'] == player)]
fig = px.scatter(dff,
x="Date",
y="Name",
color="FieldTime",
hover_name='Name', hover_data=['Position_Name','MD', 'Day_after_match','FieldTime'],
color_continuous_scale=px.colors.sequential.Bluered,
range_color= [min(activities['FieldTime']), max(activities['FieldTime'])]
)
fig.update_traces(marker=dict(symbol="square"))
fig.update_traces(marker=dict(size=9))
fig.update_layout(yaxis={'title': 'Field Time'},
title={'text': 'Field Time chart',
'font': {'size': 28}, 'x': 0.5, 'xanchor': 'center'})
return fig