HI,
I managed to set a fin fix label for each bubble in my chart here’s the code :
import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
data = {'x': [1.5, 1.6, -1.2],
'y': [21, -16, 46],
'circle-size': [10, 5, 6],
'circle-color': ["red","red","green"],
'tttt': ["ggg","vvvv","rrrr"],
}
# Create DataFrame
df = pd.DataFrame(data)
fig = px.scatter(
df,
x="x",
y="y",
color="circle-color",
size='circle-size',
text="tttt",
# hover_name="tttt",
color_discrete_map={"red": "red", "green": "green"}
)
fig.update_traces(textposition='middle right', textfont_size=14, textfont_color='black', textfont_family="Inter", hoverinfo="skip")
fig.show()
the result :
now what I’m trying to do is to put some css to these labels some this like this :
I know there s something called annotation, I tried it…I I did not suceed to do ot for each element.
if you have any idea please ?