Python | Plotting Stock charts in excel sheet using XlsxWriter module

XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs. Let’s see how to plot Stock charts using realtime data.

Charts are composed of at least one series of one or more data points. Series themselves are comprised of references to cell ranges. For plotting the charts on an excel sheet, firstly, create chart object of specific chart type( i.e Stock chart etc.). After creating chart objects, insert data in it and lastly, add that chart object in the sheet object.

Code : Plot the Stock Chart.
For plotting the Stock chart on an excel sheet, use add_chart() method with type ‘stock’ keyword argument of a workbook object.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.