multi flex binsize in legend
This commit is contained in:
@@ -1176,7 +1176,7 @@ def interactive_chart(id=0,promember=0):
|
|||||||
|
|
||||||
def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
||||||
ploterrorbars=False,
|
ploterrorbars=False,
|
||||||
title=None):
|
title=None,binsize=1):
|
||||||
|
|
||||||
if datadf.empty:
|
if datadf.empty:
|
||||||
return ['','<p>No non-zero data in selection</p>']
|
return ['','<p>No non-zero data in selection</p>']
|
||||||
@@ -1293,7 +1293,6 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
|||||||
yerr=ploterrorbars,
|
yerr=ploterrorbars,
|
||||||
point_kwargs={
|
point_kwargs={
|
||||||
'line_color':None,
|
'line_color':None,
|
||||||
'legend':yparamname,
|
|
||||||
'size':"groupsize",
|
'size':"groupsize",
|
||||||
'fill_color':"color",
|
'fill_color':"color",
|
||||||
},
|
},
|
||||||
@@ -1309,6 +1308,15 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
|||||||
else:
|
else:
|
||||||
plot.yaxis.axis_label = axlabels[yparam]
|
plot.yaxis.axis_label = axlabels[yparam]
|
||||||
|
|
||||||
|
binlabel = Label(x=100,y=100,x_units='screen',
|
||||||
|
y_units='screen',
|
||||||
|
text="Bin size {binsize:3.1f}".format(binsize=binsize),
|
||||||
|
background_fill_alpha=0.7,
|
||||||
|
background_fill_color='white',
|
||||||
|
text_color='black',
|
||||||
|
)
|
||||||
|
|
||||||
|
plot.add_layout(binlabel)
|
||||||
|
|
||||||
yrange1 = Range1d(start=yaxmin,end=yaxmax)
|
yrange1 = Range1d(start=yaxmin,end=yaxmax)
|
||||||
plot.y_range = yrange1
|
plot.y_range = yrange1
|
||||||
|
|||||||
@@ -3621,7 +3621,8 @@ def multiflex_view(request,userid=0,
|
|||||||
script,div = interactive_multiflex(df,xparam,yparam,
|
script,div = interactive_multiflex(df,xparam,yparam,
|
||||||
groupby,
|
groupby,
|
||||||
extratitle=extratitle,
|
extratitle=extratitle,
|
||||||
ploterrorbars=ploterrorbars)
|
ploterrorbars=ploterrorbars,
|
||||||
|
binsize=binsize)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user