Skip to content

Commit dd84da0

Browse files
committed
Add Axis labels to corr plot and vlines
1 parent d5f062a commit dd84da0

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

survey_dashboard/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,14 @@ def select_data_corr(question, question2, data_filters, data_filters_method):
330330
("total", "@total"),
331331
("percentage", "@percentage")]
332332

333-
title = f'{q1_key[0]} in dependence to {q2_key[0]}'
333+
title = f''#{q1_key[0]} in dependence to {q2_key[0]}'
334+
xlabel = f'{question}'
335+
ylabel = f'{question2}'
334336

335337
# Bokeh plots need a ColumnDataSource, but this can be initialized from a pandas
336338
selected = ColumnDataSource(cross_tab)
337339

338-
display_options = {'x_range' : x_range, 'y_range' : y_range,
340+
display_options = {'x_range' : x_range, 'y_range' : y_range, 'xlabel': xlabel, 'ylabel': ylabel,
339341
'title': title, 'tooltips' : tooltips}
340342

341343
return selected, display_options, marker_scale

survey_dashboard/plots.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def add_legend_at(fig, position='right'):
8787
"border_fill_color" : '#00000000',
8888
"background_fill_color" : '#00000000',
8989
"x_range.range_padding": 0.1,
90-
"xgrid.grid_line_color": None,
90+
#"xgrid.grid_line_color": None,
9191
"xaxis.major_label_orientation": 1,
9292
"title.text_font_size": '18px',
9393
"yaxis.axis_label_text_font_size": '18px',
@@ -744,6 +744,8 @@ def create_legend_corr(fig, colors=['red', 'blue', 'green', 'red', 'red', 'red']
744744
tools='')
745745
leg_items = create_legend_items(5, size_min=0, color=colors, fig=fig2, scale_m=scale_m) #[("circle", [circle])]
746746

747+
fig2.background_fill_color = '#00000000' #F7F7F7', #transparent
748+
fig2.border_fill_color = '#00000000'
747749
fig2.xaxis.axis_line_alpha= 0
748750
fig2.yaxis.axis_line_alpha= 0
749751
fig2.xgrid.grid_line_alpha = 0
@@ -872,5 +874,7 @@ def interactive_wordcloud(wordcloud, **kwargs):
872874
glyph = Text(x="x", y="y", text="text", angle='angle', angle_units='deg',
873875
text_color="color", text_font_size='font_size', text_font={'value': font_family}, **kwargs)
874876
fig.add_glyph(source, glyph)
875-
877+
878+
fig.background_fill_color = '#00000000' #F7F7F7', #transparent
879+
fig.border_fill_color = '#00000000'
876880
return fig

0 commit comments

Comments
 (0)