Exercise: Adding Customised Sliders
Practice with some lab exercises.
We'll cover the following...
We'll cover the following...
Exercise 1
Using the Hang Seng Index dataset, create a custom date slider that has a white background and a border width of 5 pixels.
hs = pd.read_csv('/usr/local/csvfiles/^HSI.csv', parse_dates=['Date'])hs.head()
Solution
-
A trace is created using the
go.Scatter()function on line 2 withxandyvalues taken from thehsDataFrame. Themodeparameter is set tolinesto create a line chart, and thenameparameter specifies the name of the trace for the legend. Themarkerparameter is used to set the color of the ...