การสร้างแดชบอร์ดด้วย Dash และ Plotly
Alex Scriven
Data Scientist
"Box Model" มองแต่ละ element ใน HTML เป็นกล่องที่มีหลายชั้น:
height และ width)
อาร์กิวเมนต์ CSS border รับค่าสามส่วน:
'border':'A B C'solid หรือ dotted)red)
dcc.Graph(figure=ecom_bar,
style={'width':'500px',
'height':'450px',
'border':'5px dotted red'}
)

การกำหนดระยะห่างของ HTML element:
เช่น 'padding':'10px 5px 5px 15px'
$$

ไม่มี padding:

เพิ่ม 'padding':'100px':

ไม่มี margin:

เพิ่ม margin: 100px auto:

ใช้: 'margin':'100px'

ใช้: 'margin':'100px auto'

element ไม่จัดแนวตรงกัน? HTML element มีสองประเภท คือ "inline" และ "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>
$$

การสร้างแดชบอร์ดด้วย Dash และ Plotly