I have this code:
data = go.Scatter(
x=positionsX,
y=positionsY,
textposition='middle center',
mode='markers+text',
marker=dict(
color=color,
opacity=[1, 1, 1, 1, 1],
size=[100, 70, 60, 30, 25]),
text=list(sumByRegion.keys()),
)
and I wanna change the textposition to 'bottom left' based on sumByRegion.keys() value.
sumByRegion.keys() is dict_values([55, 24, 16, 3, 2])
What I have now is on the image:
edit:
Actually, I was looking for set the textposition for each individual item. Therefore, I used a array of textposition to fix the problem.
data = go.Scatter(
x=positionsX,
y=positionsY,
textposition=["middle center", "middle center", "middle center", "middle right", "middle left"],
mode='markers+text',
marker=dict(
color=color,
opacity=[1, 1, 1, 1, 1],
size=[100, 70, 60, 30, 25]),
text=list(sumByRegion.keys()),
)