Créer des tableaux de bord avec Dash et Plotly
Alex Scriven
Data Scientist
Le « modèle de boîte » voit chaque élément HTML comme une boîte à couches :
height et width)
L'argument CSS border prend trois éléments :
'border':'A B C'solid ou dotted)red)
dcc.Graph(figure=ecom_bar,
style={'width':'500px',
'height':'450px',
'border':'5px dotted red'}
)

Pour régler l'espacement d'un élément HTML :
P. ex., 'padding':'10px 5px 5px 15px'
$$

Aucun padding :

Ajout de 'padding':'100px' :

Aucune marge :

Ajout de margin: 100px auto :

Avec : 'margin':'100px'

Avec : 'margin':'100px auto'

Les éléments ne s'alignent pas ? Les éléments HTML sont « inline » ou « block ».
$$
<div style='width:50px;height:50px;
background-color:blue'></div>
<div style='width:50px;height:50px;
background-color:red
;display:inline-block'></div>
<div style='width:50px;height:50px;
background-color:green;
display:inline-block'></div>
$$

Créer des tableaux de bord avec Dash et Plotly