Skip to content

Commit dfec1d8

Browse files
committed
Adjust font size on graphs in small resolutions
1 parent ee8a8c2 commit dfec1d8

2 files changed

Lines changed: 29 additions & 11 deletions

File tree

apps/dash-opioid-epidemic/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
paper_bgcolor="#F4F4F8",
207207
plot_bgcolor="#F4F4F8",
208208
autofill=True,
209+
margin=dict(t=75, r=50, b=100, l=50),
209210
),
210211
),
211212
),
@@ -330,6 +331,7 @@ def display_selected_data(selectedData, chart_dropdown, year):
330331
paper_bgcolor="#1f2630",
331332
plot_bgcolor="#1f2630",
332333
font=dict(color="#2cfec1"),
334+
margin=dict(t=75, r=50, b=100, l=75),
333335
),
334336
)
335337
pts = selectedData["points"]
@@ -379,6 +381,11 @@ def display_selected_data(selectedData, chart_dropdown, year):
379381
fig_layout["yaxis"]["tickfont"]["color"] = "#2cfec1"
380382
fig_layout["xaxis"]["gridcolor"] = "#5b5b5b"
381383
fig_layout["yaxis"]["gridcolor"] = "#5b5b5b"
384+
fig_layout["margin"]["t"] = 75
385+
fig_layout["margin"]["r"] = 50
386+
fig_layout["margin"]["b"] = 100
387+
fig_layout["margin"]["l"] = 50
388+
382389
return fig
383390

384391
fig = dff.iplot(

apps/dash-opioid-epidemic/assets/opioid.css

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,12 @@ hr {
686686
}
687687
}
688688

689+
@media (max-width: 550px) {
690+
#county-choropleth .annotation-text{
691+
font-size: 1.2rem !important;
692+
}
693+
}
694+
689695
/* Left column
690696
–––––––––––––––––––––––––––––––––––––––––––––––––– */
691697
@media only screen and (max-width: 1250px) {
@@ -727,6 +733,10 @@ hr {
727733
#graph-container {
728734
margin-top: 5rem;
729735
}
736+
737+
#selected-data {
738+
height: 55rem;
739+
}
730740
}
731741

732742
@media (min-width: 1251px) {
@@ -748,30 +758,31 @@ hr {
748758
align-items: stretch;
749759
justify-content: flex-start;
750760
}
761+
762+
#selected-data {
763+
flex-grow: 1;
764+
}
751765
}
752766

753767
@media (max-width: 550px) {
754768
#graph-container {
755769
padding: 2.5rem;
756770
}
771+
772+
#selected-data .xtick text{
773+
font-size: 1.1rem !important;
774+
}
775+
776+
#selected-data .gtitle{
777+
font-size: 1.7rem !important;
778+
}
757779
}
758780

759781

760782
#chart-dropdown {
761783
margin-bottom: 6.6rem;
762784
}
763785

764-
@media (max-width: 1250px){
765-
#selected-data{
766-
height: 55rem;
767-
}
768-
}
769-
@media (min-width: 1251px){
770-
#selected-data{
771-
flex-grow: 1;
772-
}
773-
}
774-
775786
/* Dropdown
776787
–––––––––––––––––––––––––––––––––––––––––––––––––– */
777788
.Select-value {

0 commit comments

Comments
 (0)