diff --git a/daqviewer/daqviewer.py b/daqviewer/daqviewer.py index 85e8797..09981be 100644 --- a/daqviewer/daqviewer.py +++ b/daqviewer/daqviewer.py @@ -146,12 +146,15 @@ def read_json_data(json_data): trace = go.Scatter(x=dfs.index, y=dfs[col], name=col, opacity=0.8) spec.append(trace) + # Set maximum x limit to 200% of the peak frequency + f_max = dfs.idxmax().mean() * 3 + graph_energy = dcc.Graph(id='energy-spectrum', figure={ 'data': spec, 'layout': { 'xaxis': { - 'range': [0, 3] + 'range': [0, f_max] } } })