(dff, axis_type, title)
| 134 | |
| 135 | |
| 136 | def create_time_series(dff, axis_type, title): |
| 137 | |
| 138 | fig = px.scatter(dff, x='Year', y='Value') |
| 139 | |
| 140 | fig.update_traces(mode='lines+markers') |
| 141 | |
| 142 | fig.update_xaxes(showgrid=False) |
| 143 | |
| 144 | fig.update_yaxes(type='linear' if axis_type == 'Linear' else 'log') |
| 145 | |
| 146 | fig.add_annotation(x=0, |
| 147 | y=0.85, |
| 148 | xanchor='left', |
| 149 | yanchor='bottom', |
| 150 | xref='paper', |
| 151 | yref='paper', |
| 152 | showarrow=False, |
| 153 | align='left', |
| 154 | text=title) |
| 155 | |
| 156 | fig.update_layout(height=225, margin={'l': 20, 'b': 30, 'r': 10, 't': 10}) |
| 157 | |
| 158 | return fig |
| 159 | |
| 160 | |
| 161 | @app.callback(dash.dependencies.Output('x-time-series', 'figure'), [ |
no outgoing calls
no test coverage detected