Created
November 22, 2019 04:07
Revisions
-
amitrani6 created this gist
Nov 22, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # Plotly Growth Rate Chart For The Campbell Soup Company # Calculate Growth Rate cpb['growth_rate'] = cpb['Adj Close'].pct_change() s_and_p['growth_rate'] = s_and_p['Adj Close'].pct_change() fig = go.Figure() # You can add multiple traces, in this case financial securities fig.add_trace(go.Scatter(x=cpb.Date, y=cpb['growth_rate'], name="Campbell Soup Company", line_color='deepskyblue', hovertext=cpb["Adj Close"])) fig.update_layout(title_text='CPB Growth Rates From November 21, 2018 to November 21, 2019', title={ 'y':0.9, 'x':0.5, 'xanchor': 'center', 'yanchor': 'top'}, xaxis_rangeslider_visible=True, xaxis_title="Time", yaxis_title="Growth Rate Percentage") fig.show()