Hi, @robin1,
do you want to change the thickness of an existing line or define the thickness of the lines the user might draw?
The latter can be configured like this:
newshape={'line': {'color': 'crimson', 'width': 7}}
Full example:
import pandas as pd
import plotly.express as px
import numpy as np
MONTHS = 14
vals = np.random.randint(2, 20, size=MONTHS)
months = pd.Series(pd.date_range("1/1/2023", freq="M", periods=MONTHS))
fig = px.bar(x=months, y=vals)
fig.update_layout({
'xaxis': {
'tickformat': '%y/%m',
'tickvals': months
}
})
fig.update_layout(dragmode='drawline',
# style of new shapes
newshape={'line': {'color': 'crimson', 'width': 7}})
fig.show(config={'modeBarButtonsToAdd':['drawline',
'drawopenpath',
'drawclosedpath',
'drawcircle',
'drawrect',
'eraseshape'
]})
mrep shape color