Hey! This is yet another lecture about building candlestick charts with Bokeh.
And at this point we have this candlestick chart, and in this lecture
what I'll do is I'll change the colors of these boxes, and we have green and
red there, I'll show you how to pass color code so CSS color codes there so
you can have a wide range of choices for the colors, and I will make this chart
responsive so when you minimize the window and resize it, the chart is always
there so you see all the plot elements and then we'll try some mode data so
here we have 10 days. I will try with some more months so we get a better
overview of the plot. So to get color codes for this fill color parameter you
can make a simple search CSS colors there, and if you open w3schools website,
and you scroll down, so let's find something for green, something lighter
there, this one looks good. So you paste that here, but you also need
to put the hash tag and now something to replace the red color, probably that.
Let's see what we get! So this looks probably better and now to make this
chart responsive you want to pass the responsive parameters to the figure
object and so responsive equals to true, so now if you play around with this window
you can see that the chart adjusts with the window size.
So that's good, and let's see how it works with more data, so let's start from
2015 and maybe November, yep, so you execute this and you get the new data
frame. Now you need to be careful there because here you have the old data
frames so you need to execute this cell too and the other one as well, so the
updated data frame with the three columns added there, and I'll execute the
actual code for the Bokeh plot, and here is a good overview of the stock market
data from November to March. We have quite a decline here, and then steady.
Anyway let's do some housekeeping. I'd remove this and escape shift J, select
the other cell, shift M to merge them, and then maybe remove this line.
Another shift J to merge these two. So we have the entire code in one single cell, now
you can just change these start and end times here and execute the entire code
in one press of a button. Just like that. So we've got the candlestick chart and
that's what I wanted to teach you in this lecture and throughout the next lectures
what we'll be doing is we'll embed this chart into a Flask application, so
inside a web page which is run with Flask, so that will be quite
interesting.